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 / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

preventing future dates from being entered into a field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fascal - 30 Jan 2006 16:11 GMT
Hi,

I need to prevent users from being able to enter in future dates into a date
field.  Has anyone found syntax that performs this function.

So, the logic should be that <=todaysdate

Any ideas?
Allen Browne - 30 Jan 2006 16:17 GMT
How about setting the Validation Rule for the field to:

   <=Date()

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 need to prevent users from being able to enter in future dates into a
> date
[quoted text clipped - 3 lines]
>
> Any ideas?
fascal - 30 Jan 2006 16:36 GMT
I get the reply "the expression you entered contains invalid syntax".

> How about setting the Validation Rule for the field to:
>
[quoted text clipped - 7 lines]
> >
> > Any ideas?
Allen Browne - 31 Jan 2006 01:00 GMT
Where did you try this expression?

The idea is to open your table in design view.
Select the date field.
In the lower pane of table design, place the expression beside the
Validation Rule property.

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 get the reply "the expression you entered contains invalid syntax".
>
[quoted text clipped - 7 lines]
>> >
>> > So, the logic should be that <=todaysdate
Alex Dybenko - 30 Jan 2006 17:51 GMT
Hi,
I would use textbox BeforeUpdate Event:

if me.MyTexbox > date+1 then
   msgbox "Wrong date!"
   cancel=true
end if

Signature

Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com

> Hi,
>
[quoted text clipped - 5 lines]
>
> Any ideas?
 
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.