I would like to define the query to use when opening a form based on command buttons on the mainscreen form. I've tried using a public variable defined on the mainscreen form (under general declarations) which I set to the appropriate query name at the command button (which opens the form) but this does not come across to the form being opened.
example: mainform form
General declarations
public stqueryname as string
open form cmd button
stqueryname = "qrydwgreview"
docmd.openform -----
then on the form to be opened:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = stqueryname
End Sub
This form does not recognize the stqueryname variable.
Any suggestions?
Thanks
example: mainform form
General declarations
public stqueryname as string
open form cmd button
stqueryname = "qrydwgreview"
docmd.openform -----
then on the form to be opened:
Private Sub Form_Open(Cancel As Integer)
Me.RecordSource = stqueryname
End Sub
This form does not recognize the stqueryname variable.
Any suggestions?
Thanks