W
WSF
Access 97
Thanks to Nikos Yannacopoulos over a year ago I have been using the
following very successfully to filter record returns in a query.
I create a public variable text value called BranchID, taken from a lookup
text field in a table, and use the following function as the query
criterion. For example
Public Function Get_BranchID()
Get_BranchID = BranchID
End Function
In the query criteria line I enter =Get_BranchID()
This works fine. But now I would like to also be able to pull all records
from the query.
Obviously, in design view, I would do this by manually deleting the
criterion [=Get_BranchID()] and leaving it blank.
Entering an Asterisk "*" creates the criterion Like "*". Either way I get
all records.
But is there a way to still use the Function / Criterion I have been using
to pull all records?
What "value" would I need to enter in the field of the lookup table?
I'm stumped.
Any help gratefully appreciated
WSF
Thanks to Nikos Yannacopoulos over a year ago I have been using the
following very successfully to filter record returns in a query.
I create a public variable text value called BranchID, taken from a lookup
text field in a table, and use the following function as the query
criterion. For example
Public Function Get_BranchID()
Get_BranchID = BranchID
End Function
In the query criteria line I enter =Get_BranchID()
This works fine. But now I would like to also be able to pull all records
from the query.
Obviously, in design view, I would do this by manually deleting the
criterion [=Get_BranchID()] and leaving it blank.
Entering an Asterisk "*" creates the criterion Like "*". Either way I get
all records.
But is there a way to still use the Function / Criterion I have been using
to pull all records?
What "value" would I need to enter in the field of the lookup table?
I'm stumped.
Any help gratefully appreciated
WSF