![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a query which filters defects by a system code. The collation of defects by system is achieved by setting a system variable using a form so that it is held as a global variable. I then filter the query using GetSystemID() as a criteria in the query, bringing up all defects associated with that system. A further requirement is to then recognise which of those defects have been prioritised and identify them. THis is done by allocating a code within a priority field. For example "ST" as an event code. What I wish to do is if the priority code contains "ST" then add the letters "-ST" to the defect number to signify it has priority. It would be simple to just filter for ST I know, but I want to make this a routine that can be used for any priority defects with different codes such as "L", "CFG" or any combination. I have created a form which allows the user to set the current priorities he is interested in and this stores the currently required code in a Global Variable called GBLKeyeventTIPCode a string variable I can use this to filter specific defects using a Public Sub: Public Function GetTIPCodeVariable() GetTIPCodeVariable = GBLKeyeventTIPCode End Function This is used in a query with the criteria in the query - GetTIPCodeVariable() I am aware you cannot use Global Variables directly in Queries, but it would be useful to be able to identify from the number of defects which ones were priority by using the following type of statement such as: NCSPECIFIC: IIf([NC_PRIORITY]=GetTIPCodeVariable(),[NCNUMBER] & GetTIPCodeVariable(),[NCNUMBER]) such that if the priority code matches the desired event, it adds it to the defect number, otherwise the defect number stays as is, so you would have for example: 34567ST 34568 34569 24574ST So the priorities are marked. Anyone have any examples of using a Global as a comparison inside a query like this? Thanks J |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
I am aware you cannot use Global Variables directly in Queries, but it would be useful to be able to identify from the number of defects which ones were priority by using the following type of statement such as: NCSPECIFIC: IIf([NC_PRIORITY]=GetTIPCodeVariable(),[NCNUMBER] & GetTIPCodeVariable() ,[NCNUMBER]) Have you tried this? It looks to me as if it should work. |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |