|
-
August 10th, 1999, 06:14 AM
#1
Dataenvironment
Hi all,
WinNt, VB6, DAO, Datareport
I really don't know how to change the dataenvironment. I use table(on local drive) for data report. When I make data selection on the form, the selected data are stored in that table on local drive(i.e, data in that table is always deleted prior to copying new data). But the report does not show new data.
Thanks in advance.
Ken
-
August 11th, 1999, 02:43 AM
#2
Re: Dataenvironment
u might have saved the report with data.
praba
-
August 11th, 1999, 06:00 AM
#3
Re: Dataenvironment
So, what should I do next? I don't really understand what you mean. Thanks
-
August 16th, 1999, 12:42 AM
#4
Re: Dataenvironment
Sorry for delayed reply
Pre-Requisite
Ms-Access 97 (not tested in previous verions)
Create a test Access database. Create a table and a report.
Name the report as "Report1" , in the report add a label named "Label3"
Close access Database
Open VB. Add a command button to the form
Add the code given below in the module of form(Change the names where ever required)
Run the application.
U can c that, in the printed report the caption of label3 is "Testing"
Regards
Praba
Code Snippet
------------
Option Explicit
Dim objAcc As Access.Application
Dim objRpt As Access.Report
Private Sub Command1_Click()
Set objAcc = New Access.Application
objAcc.OpenCurrentDatabase "c:\biblio97.mdb"
objAcc.DoCmd.SelectObject acReport, "report1", True
objAcc.DoCmd.OpenReport "report1", acViewDesign
Set objRpt = objAcc.Reports("report1")
objRpt("label3").Caption = "Testing"
objAcc.DoCmd.OpenReport "report1", acViewNormal
objAcc.DoCmd.Close
Set objRpt = Nothing
objAcc.CloseCurrentDatabase
Set objAcc = Nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|