I'm not too sure whether this problem will come under forms or reports but I'll post it here anyway
I need to pass the contents of a textbox on a form to a textbox on a report. I know how to pass data between forms using the OpenArgs method, and I thought this would be the same for a report. Unfortunately Access doesn't seem to like it.
I have the following code under the command button on the form that opens up the report.
Private Sub cmdPrint_Click()
DoCmd.OpenReport "RptPrint", acViewPreview, , Me!Location
End Sub
Location is the name of the textbox on the form. When Access tries to open up the report, it displays an error. I have the following code underneath the report.
Me!txtLocation = Me.OpenArgs
txtLocation is the textbox on the report. Access highlights the 'OpenArgs' and gives the error "Method or Data not found".
I know this code works with forms, why not with reports?
Any ideas??
Dave

I need to pass the contents of a textbox on a form to a textbox on a report. I know how to pass data between forms using the OpenArgs method, and I thought this would be the same for a report. Unfortunately Access doesn't seem to like it.
I have the following code under the command button on the form that opens up the report.
Private Sub cmdPrint_Click()
DoCmd.OpenReport "RptPrint", acViewPreview, , Me!Location
End Sub
Location is the name of the textbox on the form. When Access tries to open up the report, it displays an error. I have the following code underneath the report.
Me!txtLocation = Me.OpenArgs
txtLocation is the textbox on the report. Access highlights the 'OpenArgs' and gives the error "Method or Data not found".
I know this code works with forms, why not with reports?
Any ideas??
Dave