Best way to show messages

  • Thread starter Thread starter Brian C
  • Start date Start date
B

Brian C

I input some data in form1 and access a record from table1
using this data in SQL code executed from clicking a
button on the form.

If the record doesn't contain a certain value I want to
output a message and set focus to get the user to reenter
data to try another record.

What is the best way of showing the message, i.e. in a
popup or on the form and how do I do this using the form
definition and supporting code? How do I set the focus
back to the first input field on the form?
 
on button click
Try to retrieve record
if value does not exist in record
msgbox "The data does not exist", vbokonly, "Data Not Found"
docmd.gotocontrol "field1"
exit sub
endif
'record does contain value
continue with code
HTH
Kat
 
Back
Top