Steiny386
New member
- Local time
- Today, 09:20
- Joined
- Sep 4, 2003
- Messages
- 5
Hello...first post, so bare with me
I am trying to use a global variable in the criteria of a query. Actually I want to use global variables for many fields in the querie's criteria...for example:
Field: JobName, Criteria: =X-73845 (which I get from a combo and set a global variable equal to)
Field: JobStartTime, Criteria: =6/12/2003 8:42 PM (as date)...(which I get from a combo and set a global variable equal to)
Field: PartsRan, Criteria: <500 (which I get from a combo and set a global variable equal to)
In other words I am using strings, integers and dates....getting them from a combo box and setting global variables equal to them...so I can use them later.
I don't know how to use the global variable in my query...I can use them in my forms, just not my queries.
-----------------------------------------------------------
Next thing is how do I basically not look for a criteria if one of the combo boxes is left empty. For example: If I allow them to query by operator but they do not want to narrow it down that much...how do I NOT query according to that criteria if my global variable is basically a null now?
Currently I am deleting my query and creating a new query with an SQL statement using the combo info for my where portion of the SQL.
Am I stuck doing it the way I am or is there another way?...There's always two ways to skin a cat...Right?
Thank you for your time in advance!
I am trying to use a global variable in the criteria of a query. Actually I want to use global variables for many fields in the querie's criteria...for example:
Field: JobName, Criteria: =X-73845 (which I get from a combo and set a global variable equal to)
Field: JobStartTime, Criteria: =6/12/2003 8:42 PM (as date)...(which I get from a combo and set a global variable equal to)
Field: PartsRan, Criteria: <500 (which I get from a combo and set a global variable equal to)
In other words I am using strings, integers and dates....getting them from a combo box and setting global variables equal to them...so I can use them later.
I don't know how to use the global variable in my query...I can use them in my forms, just not my queries.
-----------------------------------------------------------
Next thing is how do I basically not look for a criteria if one of the combo boxes is left empty. For example: If I allow them to query by operator but they do not want to narrow it down that much...how do I NOT query according to that criteria if my global variable is basically a null now?
Currently I am deleting my query and creating a new query with an SQL statement using the combo info for my where portion of the SQL.
Am I stuck doing it the way I am or is there another way?...There's always two ways to skin a cat...Right?
Thank you for your time in advance!