Message box on opening a record under certain conditions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When a record is opened (i.e. when a particular ref number is chosen from the
dropdown and the relevant form opens) we need to have a reminder message if
certain data has not been entered yet.
For example, if the Insurance Value control is empty, there should be a
popup box saying "Check Insurance!".
I have tried various things but no good yet, so help would be very welcome!
Many thanks
CW
 
Form's OnOpen event:

If Nz(Me.Yourtextbox,"") = "" Then
msgbox "Whatever you need to say"
End If
 
CW said:
When a record is opened (i.e. when a particular ref number is chosen from
the
dropdown and the relevant form opens) we need to have a reminder message
if
certain data has not been entered yet.
For example, if the Insurance Value control is empty, there should be a
popup box saying "Check Insurance!".
I have tried various things but no good yet, so help would be very
welcome!
Many thanks
CW

The form's Current event fires whenever a record is loaded. You could put
code into that event to check the values in certain fields and display
messages if they are blank (or whatever).

Carl Rapson
 
Susan -
Thanks, but that works only when first opening the form, upon which it shows
the first of my records by default. When I then select the record I want to
go to (by selecting its reference in a combo dropdown), even if the
particular field is empty, that code doesn't work.
Close, but not there yet!!
Hope you can come up with the extra bit to achieve this
Many thanks
CW
 
Susan -
Thanks, but that works only when first opening the form, upon
which it shows the first of my records by default. When I then
select the record I want to go to (by selecting its reference
in a combo dropdown), even if the particular field is empty,
that code doesn't work. Close, but not there yet!!
Hope you can come up with the extra bit to achieve this
Many thanks
CW
Just move the code to the OnCurrent event. This will trigger
whenever a different record is selected.
If the form is also used to enter new records, you will want to
put a
If Not me.newrec then above the code block, with the End If
below.
 
Back
Top