Click to See Complete Forum and Search --> : Dataenvironment
Ken Swan
August 10th, 1999, 06:14 AM
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
Praba S
August 11th, 1999, 02:43 AM
u might have saved the report with data.
praba
Ken Swan
August 11th, 1999, 06:00 AM
So, what should I do next? I don't really understand what you mean. Thanks
Praba S
August 16th, 1999, 12:42 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.