Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Date Parameters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HELPMEMEME - 24 Jul 2007 16:00 GMT
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
Klatuu - 24 Jul 2007 16:40 GMT
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.
Signature

Dave Hargis, Microsoft Access MVP

> 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?
[quoted text clipped - 17 lines]
>     End If
> End Sub
Jon-e-walker - 24 Jul 2007 16:56 GMT
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...

> You code is behaving as expected.
> you are declaring two date variables (incorrectly named, int usually means
[quoted text clipped - 30 lines]
>
> - Show quoted text -
Klatuu - 24 Jul 2007 17:04 GMT
Where are the dates you want to compare?
Signature

Dave Hargis, Microsoft Access MVP

> Ok... so how can I compare them... what controls... I have a basic
> Knowledge on the new 2007 Access... Please offer some guidance on
[quoted text clipped - 34 lines]
> >
> > - Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.