Clear Field Upon Msg Box Click

  • Thread starter Scarlet via AccessMonster.com
  • Start date
S

Scarlet via AccessMonster.com

Good Day,

I presently have a set of code where if the conditions are not met as
specified a text box pops up informing the user of this error. I would like
the text box ( txtDeed ) to reset once they click the ok of the msg box..
....Seems simple enough I know, though I am still relatively new to
programming, thanks!!!

Dim iResponse As Integer


If gstRCode <> Left(txtDeed.Text, 2) Then
iResponse = MsgBox("Resort Code & Deed Inventory Code Must Match", vbOKOnly +
vbCritical, "Deed & Resort Do Not Match")

End If
End Sub
 
B

Barry Gilbert

Scarlet,
Put your code in the textbox's BeforeUpdate event. After your msgbox, put:
Cancel=True

This will cancel the update of the textbox.

Barry
 
Top