Override system message

  • Thread starter Lynn Pennington
  • Start date
L

Lynn Pennington

I have a table with some required fields.

I have a form to edit the fields.

How do I override the system message that it is
a "Required Field"? I would like to have a simple message
for the end user "Invalid Server Name." with a "OK" button
then set focus on the text box.

If IsNull(Me.txtServerName) Then
Msgbox "Invalid Server Name."
Me.txtServerName.SetFocus
End If

Please advise.
Thanks.
Lynn.
 
J

John Vinson

How do I override the system message that it is
a "Required Field"? I would like to have a simple message
for the end user "Invalid Server Name." with a "OK" button
then set focus on the text box.

If IsNull(Me.txtServerName) Then
Msgbox "Invalid Server Name."
Me.txtServerName.SetFocus
End If

Put this code as written in the Form's BeforeUpdate event, and in
addition add a line before the End If

Cancel = True
 
L

Lynn Pennington

Thank You. Lynn.
-----Original Message-----


Put this code as written in the Form's BeforeUpdate event, and in
addition add a line before the End If

Cancel = True



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top