openargs aren't passed for some reason

qwertyjjj

Registered User.
Local time
Yesterday, 19:19
Joined
Aug 8, 2006
Messages
262
In my form I have a print button, which runs:

Private Sub cmd_Print_Click()
Dim strReportArgs As String

strReportArgs = Forms!TabsReport!Top10_BU.Form.RecordSource
MsgBox (strReportArgs)
DoCmd.OpenReport "Top10Report", acViewNormal, , , , strReportArgs

End Sub

This displays a message box with the correct recordsource.

On the report loading I have:

Private Sub Report_Open(Cancel As Integer)

MsgBox ("HERE")
MsgBox (Me.OpenArgs)

End Sub

This throws up a null error on the Me.OpenArgs line every time but I cannot work out why ?
 
declare a string variable and set that equal to the openargs value and then use that in the message box. Put a break in the message box line and check the value that is in the variable.
 

Users who are viewing this thread

Back
Top Bottom