Hi
Im using a wrapper function in a query to hopefully choose between two different events.
I set a global variable using
What it does is this.
If the user is a BMAN (Branch Manager) and the user is eather one of two users I want to set a wrapper function to show certain values.
So I set G_LOCATION here, this works OK.
I then have a query
That calls the following wrapper function LOCATION()
This is LOCATION()
What I want this to do is set the query to either use LIKE or NOT LIKE, can this be done this way ?
Im using a wrapper function in a query to hopefully choose between two different events.
I set a global variable using
Code:
Private Sub cboUser_AfterUpdate()
G_Surname = Me.cboUser.Column(0)
G_Forename = Me.cboUser.Column(1)
G_AStaffNo = Me.cboUser.Column(2)
G_Password = Me.cboUser.Column(3)
G_Region = Me.cboUser.Column(4)
G_Regiontxt = Me.cboUser.Column(5)
G_Director = Me.cboUser.Column(6)
G_Location = Me.cboUser.Column(7)
Select Case G_Level
Case "DIRC"
G_AStaffNo = "*"
G_Region = "*"
G_Director = Me.cboUser.Column(6)
Case "BMAN"
If G_AStaffNo = "100473" Then
G_Location = "Like BES"
ElseIf G_AStaffNo = "100467" Then
G_Location = "Not Like BES"
End If
G_AStaffNo = "*"
G_Director = "*"
G_Region = Me.cboUser.Column(4)
Case "BADM"
G_AStaffNo = Me.cboUser.Column(2)
G_Director = "*"
G_Region = "*"
End Select
Me.txtPassword.Visible = True
Me.txtPassword.SetFocus
End Sub
What it does is this.
If the user is a BMAN (Branch Manager) and the user is eather one of two users I want to set a wrapper function to show certain values.
So I set G_LOCATION here, this works OK.
I then have a query
Code:
SELECT dbo_MASTER1.STATUS, Left([LOCATION],3) AS LOC, dbo_MASTER1.FIRSTNAME, dbo_MASTER1.STAFFNO, dbo_MASTER1.SURNAME
FROM ((dbo_MASTER1 LEFT JOIN dbo_EXITINTERVIEW ON dbo_MASTER1.STAFFNO = dbo_EXITINTERVIEW.STAFFNO) LEFT JOIN dbo_CURRENTPAY ON dbo_MASTER1.STAFFNO = dbo_CURRENTPAY.STAFFNO) LEFT JOIN dbo_CONTACTS ON dbo_MASTER1.STAFFNO = dbo_CONTACTS.STAFFNO
WHERE (((dbo_MASTER1.STATUS)="Active") AND ((Left([LOCATION],3))=Location()));
That calls the following wrapper function LOCATION()
This is LOCATION()
Code:
Public Function LOCATION() As String
LOCATION = G_Location
End Function
What I want this to do is set the query to either use LIKE or NOT LIKE, can this be done this way ?