G
Guest
Hello,
I've got a button that when pushed will declare my VarCurrQry variable as a
parameter that I then want to pass to a query.
From reading posts it looks like I need to set up a module but I'm getting
confused about where to declare VarCurrQry.
In my form Objects I have the following:
Option Compare Database
Option Explicit
Public VarCurrQry As Variant
____________________________
Private Sub CmdViewOpen_Click()
VarCurrQry = "OPEN ITEM"
DoCmd.OpenQuery "Qry-RESEARCH", acViewNormal, acReadOnly
End Sub
But the Module recognizes (ie auto caps) the var VarCurrQry but gives me an
error that it's undefined:
Module1:
Option Compare Database
Option Explicit
____________________
Function QryParamater()
QryParameter = VarCurrQry
End Function
Any suggestions?
Thank you!
I've got a button that when pushed will declare my VarCurrQry variable as a
parameter that I then want to pass to a query.
From reading posts it looks like I need to set up a module but I'm getting
confused about where to declare VarCurrQry.
In my form Objects I have the following:
Option Compare Database
Option Explicit
Public VarCurrQry As Variant
____________________________
Private Sub CmdViewOpen_Click()
VarCurrQry = "OPEN ITEM"
DoCmd.OpenQuery "Qry-RESEARCH", acViewNormal, acReadOnly
End Sub
But the Module recognizes (ie auto caps) the var VarCurrQry but gives me an
error that it's undefined:
Module1:
Option Compare Database
Option Explicit
____________________
Function QryParamater()
QryParameter = VarCurrQry
End Function
Any suggestions?
Thank you!