Real Wally
Registered User.
- Local time
- Today, 22:27
- Joined
- Jan 28, 2003
- Messages
- 107
I’m trying to create a report from a cmdButton on a form with 2 subforms.
The main form has the linking filed.
Using the code below I get a pop-up that asks for a criteria value and has the wanted value (the IDnumber in the form) above the input field. If I manually enter that number I get the correct report.
What is wrong with my code below?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Report"
stLinkCriteria = "[IDnumber]=" & Me![IDnumber] & ""
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
DoCmd.RunCommand acCmdPreviewOnePage
Thanks,
Wally
The main form has the linking filed.
Using the code below I get a pop-up that asks for a criteria value and has the wanted value (the IDnumber in the form) above the input field. If I manually enter that number I get the correct report.
What is wrong with my code below?
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Report"
stLinkCriteria = "[IDnumber]=" & Me![IDnumber] & ""
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
DoCmd.RunCommand acCmdPreviewOnePage
Thanks,
Wally