Syntax for an error message

  • Thread starter Thread starter Meryl
  • Start date Start date
M

Meryl

Can you tell me what is the syntax for sending an error
message to a form from an event procedure?

Thx.
 
I did review it and it doesn't make sense to me. I have
an event procedure that creates a record from a command
button. Once the record is created, I don't want the
user to create another one.

In my event procedure if they push the button, I want to
test the extistence of a value in a field. If it exists,
I want to return an error message. Can you give me an
example of this code?

thank you.
 
In the on-click event of the button, place the following
code before the code that creates the record. Replace the
text between the quotes with whatever you wish the nessage
to say (first set) and what you want in the header of the
message box (2nd set):

if not isNull(FieldName) then
msgbox "Record already created", vbCritical, "Error"
exit sub
end if

Rgds,
Glenn
 
Back
Top