Required Date

G

Guest

I have a date field in a form. Right now people can add records and skip over
the date field.
I need to set that field so that users can't add a new record without adding
a date.
So basically how do I make that field required? Also create a pop up if they
try and skip over it it says "Date Field Required".
Also do I need to change that line in the table??
Thanks.
 
G

Guest

Rick B's suggestion will work; however, you don't have very good control over
the situation, and the message Access presents is hard for users to
understand. The better approach is to code something like this in the Before
Update event of your form:

If Not IsDate(Me.MyRequiredDateField) Then
MsgBox "Required Date is Missing or is Not a Valid Date", _
vbExclamation+ vbOkOnly, "Date Entry Error"
Cancel = True
Me.MyRequiredDateField.SetFocus
End If
 
S

Steve Schapel

Str8,

In the design of the table, set the Validation Rule property to...
Is Not Null
.... and in the Validation Text property enter the text you want
displayed to the user if they miss it.
This will be activated at the point where you leave the record or
otherwise try to save the record.
 
G

Guest

Once again, I avoid using any field or table validation. First, you don't
have the same control you do using control or form validation. There is also
the upsizing issue. Other database systems do not understand Access field
and table validation. Should you ever want to upsize, you would have to
rewrite anyway.
 
G

Guest

Thats for the responses I appreciate it.

Klatuu said:
Once again, I avoid using any field or table validation. First, you don't
have the same control you do using control or form validation. There is also
the upsizing issue. Other database systems do not understand Access field
and table validation. Should you ever want to upsize, you would have to
rewrite anyway.
 
S

Steve Schapel

Klatuu,

This is an Access newsgroup, so I assumed Str8 was asking a question
about Access. The Validation Rule property of fields in Access tables
is a very cool and useful feature.
 
G

Guest

Exactly, Steve. It is about Access. How many different databases can Access
connect to? How many of them support field and table validation? Why is
there an upsizing wizard? You will not convice me the Validation Rule
property is even of any real value, much less cool and useful. I consider
them to be much like Macros - training wheels for those not skilled in
database systems.

I have seen your posts here and I consider you competent. We will have to
agree to disagree on this.
 

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