RangerTen
Rangers Lead The Way!
- Local time
- Today, 01:35
- Joined
- Jun 30, 2002
- Messages
- 42
Can someone help me out with using a variable in a sql query
I want the global variable to be the condition
SELECT tblMain.autonumber, tblMain.CaseNumber, tblMain.Handler, tblMain.[K-9], tblMain.Date
FROM tblMain, tblDefaultValues
WHERE (((tblMain.Handler)=[tblDefaultValues].[Officer])); is what I have now
right now the WHERE condition is set from a field in a table. however, I want it to be set from a global variable called
OfficerLogged
WHERE (((tblMain.Handler)=OfficerLogged));
Anyone help me with this? Thanks
What is the syntax to use a variable rather than a field in a table or on a form.
I want the global variable to be the condition
SELECT tblMain.autonumber, tblMain.CaseNumber, tblMain.Handler, tblMain.[K-9], tblMain.Date
FROM tblMain, tblDefaultValues
WHERE (((tblMain.Handler)=[tblDefaultValues].[Officer])); is what I have now
right now the WHERE condition is set from a field in a table. however, I want it to be set from a global variable called
OfficerLogged
WHERE (((tblMain.Handler)=OfficerLogged));
Anyone help me with this? Thanks
What is the syntax to use a variable rather than a field in a table or on a form.