Date Parameters

G

Guest

How can I make a Validation Rule That limits the user from inputing a date on
the Termination Field that is on or Before the Starting Date Field?

The code Bellow just changes both Date Fields to "12:00:00 am" Hour Format???


Private Sub Termination_Date_AfterUpdate()
Dim intSDate As Date
Dim intTDate As Date

Starting_Date = intSDate
Termination_Date = intTDate

If intSDate < inTDate Then
MsgBox "The Termination Date may not be on or before the Starting
Date"
End If

If intSDate > inTDate Then
btnTermination.Enabled = True
End If
End Sub
 
G

Guest

You code is behaving as expected.
you are declaring two date variables (incorrectly named, int usually means
an integer variable, dtm or dat usually means date/time), but you never put
anything in them. If you are trying to compare two dates on your form, you
don't need the variables, you can use the controls.

Neither are fields. The are variables. And, forms do not have fields.
Fields belong to tables and queries. If it is on a form, it is a control.
 
J

Jon-e-walker

Ok... so how can I compare them... what controls... I have a basic
Knowledge on the new 2007 Access... Please offer some guidance on
camparing Dates... Thanks...
 

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