Wildcard in a string

Deniseobx

Registered User.
Local time
Yesterday, 18:21
Joined
Jun 20, 2007
Messages
36
HI ALL,

I have the following code:


Private Sub CmBXResolution_AfterUpdate()
If (Me.CmBXResolution = "ESCALATED TO MANAGER") Then
Me.Escalate = True
Else
Me.Escalate = False
End If
End Sub

which means, if user selects the option "ESCALATED TO MANAGER" from my Resolution combobox then the checkbox escalate is automatically set to True. But that I have to replace the "MANAGER" portion of the the string with the name of each of our managers and have them as different options in the combobox, so I'd like to have in the criteria of the IF statement something like this: ESCALATED TO *
How would I make it to compare only the first word of the string to automatically set my other control to True?

I would appreciate your thoughts :confused:
 
HI ALL,

I have the following code:


Private Sub CmBXResolution_AfterUpdate()
If (Me.CmBXResolution = "ESCALATED TO MANAGER") Then
Me.Escalate = True
Else
Me.Escalate = False
End If
End Sub

which means, if user selects the option "ESCALATED TO MANAGER" from my Resolution combobox then the checkbox escalate is automatically set to True. But that I have to replace the "MANAGER" portion of the the string with the name of each of our managers and have them as different options in the combobox, so I'd like to have in the criteria of the IF statement something like this: ESCALATED TO *
How would I make it to compare only the first word of the string to automatically set my other control to True?

I would appreciate your thoughts :confused:

Try using the Like operator

Code:
Private Sub CmBXResolution_AfterUpdate()
If (Me.CmBXResolution Like "ESCALATED TO *") Then
Me.Escalate = True
Else
Me.Escalate = False
End If
End Sub
 
thanks a lot DJKarl!
 

Users who are viewing this thread

Back
Top Bottom