Form design

J

Jim Lavery

How can I get access to prompt for completion of certain essential fields if
not completed by the inputter as they try to exit a record.
 
R

Rick Brandt

Jim Lavery said:
How can I get access to prompt for completion of certain essential fields if
not completed by the inputter as they try to exit a record.

The simplest is to make the required fields at the table level. Then the record
will not save unless they are filled in. An alternative is to run code in the
form's BeforeUpdate event. That code can test to see which fiedls were not
filled in, cancel the update if an important field was not filled in and provide
a message to the user.

Simple example:

Private Sub Form_BeforeUpdate(Cancel As Integer)

If IsNull(Me!SomeField) Then
MsgBox "You must provide a value for Some Field"
Cancel = True
End Sub
 

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