Hi
I am trying to pass value from a button to my report using Table Culum called FormID = 1 or 2 or 3.
In the Report I used Recorsource SQL as below -
SELECT tblHelp.FormID, tblHelp.HelpID, tblHelp.HelpCategory, tblHelp.HelpFormPageName, tblHelp.HelpQuestion, tblHelp.HelpAnswer, tblHelp.HelpImageLink
FROM tblHelp
WHERE (((tblHelp.[FormID])=[Forms]![rptHelp]![FormID]));
When I open the report directly, it ask for Parameter value and if I enter value = 1 or 2 or 3 (FormID), it shows all FormID which has value=1, which I was expecting.
In my form, I used a button which contains below vba -
Private Sub lblhelp_Click()
formnum = 1
' change the 1 above to the correct FormID value
DoCmd.OpenForm "rptHelp", , , "FormID=" & formnum
End Sub
I am getting below ERROR -
The form name 'rptHelp' is misspelled or refers to a form that doesnt exist
And in DEBUG highlight -
DoCmd.OpenForm "rptHelp", , , "FormID=" & formnum
Could you please help to work it around?
Regards
Babui386
I am trying to pass value from a button to my report using Table Culum called FormID = 1 or 2 or 3.
In the Report I used Recorsource SQL as below -
SELECT tblHelp.FormID, tblHelp.HelpID, tblHelp.HelpCategory, tblHelp.HelpFormPageName, tblHelp.HelpQuestion, tblHelp.HelpAnswer, tblHelp.HelpImageLink
FROM tblHelp
WHERE (((tblHelp.[FormID])=[Forms]![rptHelp]![FormID]));
When I open the report directly, it ask for Parameter value and if I enter value = 1 or 2 or 3 (FormID), it shows all FormID which has value=1, which I was expecting.
In my form, I used a button which contains below vba -
Private Sub lblhelp_Click()
formnum = 1
' change the 1 above to the correct FormID value
DoCmd.OpenForm "rptHelp", , , "FormID=" & formnum
End Sub
I am getting below ERROR -
The form name 'rptHelp' is misspelled or refers to a form that doesnt exist
And in DEBUG highlight -
DoCmd.OpenForm "rptHelp", , , "FormID=" & formnum
Could you please help to work it around?
Regards
Babui386