Message Boxes

  • Thread starter Thread starter mary
  • Start date Start date
M

mary

Hello-
I was hoping someone can help me. I don;t know how to
write the code for creating a message box that lets you
do have a selection of yes or no --
Essentially, I did a dcount in a macro to see if a
duplicate value existed and if it does it sends a message
that " this record exists"
However, I need to do more and I don;t know what to do

So on the event before update
check to see if value in txt box (non primary value and
can be duplicates) exists in the underlying table-
if it exists then the user can say yes I want to go to
that record or no I want to continue adding the record
even though one like it exists and move the focus back
and don't prompt me on a before update : )

please help
thanks in advance
 
The second argument of the MsgBox function allows you to specify the button
type(s) and the icons and the default button. See Help for more info.

In general, to have a yes/no button where the no button is the default
choice and where you want to use the question mark icon:

MsgBox "My Message Here", vbYesNo + vbQuestion + vbDefaultButton2, "Title"
 
Back
Top