Message box on opening a record under certain conditions

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
 
S

SusanV

Form's OnOpen event:

If Nz(Me.Yourtextbox,"") = "" Then
msgbox "Whatever you need to say"
End If
 
C

Carl Rapson

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
 
G

Guest

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
 
B

Bob Quintal

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top