Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables 1

Status
Not open for further replies.

gary1

Technical User
Aug 6, 2002
5
How do I create a variable that I can use in 2 different queries. Rather than type the same dates twice I would like to store then in a variable then use them as I need them.

Any help would be much appreciated.
 
Create a Public Variable in a module

i.e.

Public strVar as String

Store the Value to the variable in your code, then when you want to use it in your query's Criteria Row, call it from a Public Function

Ex: of Public Function

Public Function ReturnVar()
ReturnVar = strVar
End Function


Use this for the Query's Criteria Row

ReturnVar()


PaulF
 
Thanks PaulF

Worked a treat and helped out inn another area too Regards

Matt

matt@begg-uk.co.uk
 
Thanks Paul worked a treat :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top