I need to automate a report in a different database.
Dim RPT as Report
Set MyDB = wrkJet.OpenData base(Applicatio n.CurrentProjec t.Path &
"\Mydb.mdb" , True, False)
For i = 0 To MyDB.Containers (5).Documents.C ount - 1
If MyDB.Containers (5).Documents(i ).Name = "MyReport" Then
'the following line works
DoCmd.OpenRepor t MyDB.Containers (5).Documents(i ).Name,
acViewDesign
'I need to set the object RPT to the remote report that is now in design
mode.
'The following line of code does not work:
Set rpt = MyDB.Containers (5).Documents(i ).Properties(0) .Name
End If
Next i
Thank you for your help
							
						
					Dim RPT as Report
Set MyDB = wrkJet.OpenData base(Applicatio n.CurrentProjec t.Path &
"\Mydb.mdb" , True, False)
For i = 0 To MyDB.Containers (5).Documents.C ount - 1
If MyDB.Containers (5).Documents(i ).Name = "MyReport" Then
'the following line works
DoCmd.OpenRepor t MyDB.Containers (5).Documents(i ).Name,
acViewDesign
'I need to set the object RPT to the remote report that is now in design
mode.
'The following line of code does not work:
Set rpt = MyDB.Containers (5).Documents(i ).Properties(0) .Name
End If
Next i
Thank you for your help
 
	
Comment