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 2005

Tip: Looking for answers? Try searching our database.

Date field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alex Martinez - 30 Jul 2005 08:45 GMT

Hello,

I am using Access 2002.  In my form I have a received date text box and a
reassigned date text box and a completed date text box.  What I don't want
is to have the user input a completed date that is actual before the
received or reassigned date text box.  For example - Let's say the received
date was July 25, 2005 and later it has an reassigned date at July 29, 2005,
but the user input July 1, 2005 in the completed date text box.  I don't
want that to happen - My question is how do I prevent this? or have an error
message pop up.  Any tips or suggestions will be appreciated.  Thank you.
Allen Browne - 30 Jul 2005 12:01 GMT
Use the BeforeUpdate event procedure of the *form* (not text box) to perform
the comparions.

Example code:

Private Sub Form_BeforeUpdate(Cancel As Integer)
   If Me.[reassigned date] < Me.[received date] Then
       Cancel = True
       MsgBox "Cannot be reassigned before received."
   End If
End Sub

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I am using Access 2002.  In my form I have a received date text box and a
> reassigned date text box and a completed date text box.  What I don't want
[quoted text clipped - 5 lines]
> or have an error message pop up.  Any tips or suggestions will be
> appreciated.  Thank you.
 
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.