Help troubleshooting simple code

lscheer

Registered User.
Local time
Today, 04:40
Joined
Jan 20, 2000
Messages
185
I'm not sure why this isn't working for me, but any logical event I attempt to attach this code to does not seem to produce any result, let alone the desired one. All other codes behind this form/controls seem to work just fine, so I started thinking perhaps something is wrong with what I'm trying to achieve. All I want to do is display a message box if TWO fields match the specified values together. Any help is greatly appreciated.

'Requires data entry into StipendGranted and StipendFundSource fields
If (Me.TrgCode = "AQ*" And Me.SelectionStatus = "Selected") Then
MsgBox "You must indicate whether or not this person received a travel stipend and the source of funds for the stipend.", vbOKOnly
Else
End If
 
If left(Me!TrgCode,2) = "AQ" And Me!SelectionStatus = "Selected" Then

???
 
Two things:

1) If (Me.TrgCode Like "AQ*" And Me.SelectionStatus = "Selected") Then
2) if you use Ken's way I would choose a more specific function:
If left$(Me.TrgCode,2) = "AQ" And Me!SelectionStatus = "Selected" Then

Notice the "$", and the "." instead of the "!"
 

Users who are viewing this thread

Back
Top Bottom