bassman197
Registered User.
- Local time
- Today, 06:22
- Joined
- Sep 18, 2007
- Messages
- 35
I would like to open a custom dialog form if a user includes the word "Addeudum" in a text box AND the property Addendum Yes is No (False).
What I have so far is:
Private Sub Notes_AfterUpdate()
If Me.Notes.Value Like *"ddendum"* And Me.[Addendum Yes] = False Then
DoCmd.OpenForm "See Addendum Error", acNormal
Else
Exit Sub
End If
End Sub
The idea is that if a user includes the word addendum in the notes, but has not set the check box for See Addendum on the contract to "yes", the error form will open. Also, my theory is that whether the user types Addendum or addendum (either case), this will still trigger with the criteria "ddendum", but my first line of code produces an error. I've also tried
#Like "*"&"ddendum"&"*"#.
I'm sure that I'm simply not enclosing something in parenthesis or quotes, but I've never tried using Like in VBA before. Any ideas greatly appreciated!
What I have so far is:
Private Sub Notes_AfterUpdate()
If Me.Notes.Value Like *"ddendum"* And Me.[Addendum Yes] = False Then
DoCmd.OpenForm "See Addendum Error", acNormal
Else
Exit Sub
End If
End Sub
The idea is that if a user includes the word addendum in the notes, but has not set the check box for See Addendum on the contract to "yes", the error form will open. Also, my theory is that whether the user types Addendum or addendum (either case), this will still trigger with the criteria "ddendum", but my first line of code produces an error. I've also tried
#Like "*"&"ddendum"&"*"#.
I'm sure that I'm simply not enclosing something in parenthesis or quotes, but I've never tried using Like in VBA before. Any ideas greatly appreciated!