L
ladybug via AccessMonster.com
I have a form called frm_pip_at. On this form I have a text box called
pip_id. I also have a command button with an on click even procedure. This
opens a report called rpt_pip_at. The report also has the text box pip_id.
When the command button is clicked I want the report to open in print preview
and the pip_id that was on the form is now opened on the report. Can someon
help me with the code for this?
This is what I have:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rpt_pip_at"
stLinkCriteria = "[pip_id]=" & "'" & Me![pip_id] & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Where do I put to open it in print preview. It is trying to print it. I am
also getting an error that "Data type mismatch in criteria expression." Do I
need to rename somthing? Please help!
pip_id. I also have a command button with an on click even procedure. This
opens a report called rpt_pip_at. The report also has the text box pip_id.
When the command button is clicked I want the report to open in print preview
and the pip_id that was on the form is now opened on the report. Can someon
help me with the code for this?
This is what I have:
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rpt_pip_at"
stLinkCriteria = "[pip_id]=" & "'" & Me![pip_id] & "'"
DoCmd.OpenReport stDocName, , , stLinkCriteria
Where do I put to open it in print preview. It is trying to print it. I am
also getting an error that "Data type mismatch in criteria expression." Do I
need to rename somthing? Please help!