Message Box in a form

  • Thread starter Thread starter jward
  • Start date Start date
J

jward

I have created a form for input into a table. When the
User enters the 2 digit month into the Audit field it
compares that 2 digit # with the month # from the Event
Date. It then pops up a message box if the Audit month
is prior to the Event month. That works correctly. I
also want it to beep when this occurs. How do I do
that. I have entered the following expression in the
Before Update field for the Audit field.
=IIf(Format([EventDate],"mm")>[RecordingPeriod],MsgBox
("WARNING! Audit Period is prior to Event Date"))
 
I have created a form for input into a table. When the
User enters the 2 digit month into the Audit field it
compares that 2 digit # with the month # from the Event
Date. It then pops up a message box if the Audit month
is prior to the Event month. That works correctly. I
also want it to beep when this occurs. How do I do
that. I have entered the following expression in the
Before Update field for the Audit field.
=IIf(Format([EventDate],"mm")>[RecordingPeriod],MsgBox
("WARNING! Audit Period is prior to Event Date"))

=IIf(Format([EventDate],"mm")>[RecordingPeriod],MsgBox
("WARNING! Audit Period is prior to Event Date"),vbCritical)

There is a system wide sound that can be selected from Windows for
the message box.
In Windows XP...
Start + Control Panel + Sounds and Audio Devices + Sounds
Select a sound for the Default Beep, Critical, Exclamation, Question,
etc.
This will effect all programs, not just Access.
Once you have selected the sounds it will beep when the message box
appears. If you have added one of the vbConstants, (see my vbCritical
above), then that sound will occur instead of the Default.

You can also write
Beep
in the VBA code window to make a sound.

Of course it won't mean anything if you haven't installed the sounds
or the speakers are turned off!!
 
Back
Top