FarmboyEsq
Programmer
I must be stupid!!! Basically I want to use a function as in the criteria for a query. I've found a few examples on the net and believe I'm very close.
The Function is
Public Function GetPkgName() As String
GetPkgName = strPkgNamePublic
End Function
My query references GetPkgName() in the criteria and if I force a value for this inside the function it works fine. My problem is, how do I set the value, before I open the query.
I've attempted this in the VBA procedure behind the form:
(in the general declarations)
Public strPkgNamePublic As String
(In a private sub click event)
strPkgNamePublic = Me!fldANSPkgName
strFunc = GetPkgName()
The MSGBOX displays I put in the function show no value for strPkgName Public. Therefore, it has nothing to work with.
Arg! Help! Thanks!
Stg
The Function is
Public Function GetPkgName() As String
GetPkgName = strPkgNamePublic
End Function
My query references GetPkgName() in the criteria and if I force a value for this inside the function it works fine. My problem is, how do I set the value, before I open the query.
I've attempted this in the VBA procedure behind the form:
(in the general declarations)
Public strPkgNamePublic As String
(In a private sub click event)
strPkgNamePublic = Me!fldANSPkgName
strFunc = GetPkgName()
The MSGBOX displays I put in the function show no value for strPkgName Public. Therefore, it has nothing to work with.
Arg! Help! Thanks!
Stg