Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only allow input between certain times 1

Status
Not open for further replies.

Craigieboy

Programmer
May 25, 2001
71
GB
Hi all,

I have a simple input box which writes a value to a database.

I would like to add, as part of my validation, that this input box can only be updated between 3pm on any Friday and 10am on any Monday. Should an attempt be made at any time outwith this period an error message is displayed.

I would be eternally greatful if anyone could help!

Thanks in advance,
Craigieboy
 
Hi

You could try this:

Code:
wkDay = DatePart("w", Date)
tmNow = DatePart("h", time)
	
If (wkDay >= vbFriday and tmNow > 15) and (wkDay <= vbMonday and tmNow <= 10) then
    'error message goes here
else
    'processing stuff goes here
end if

HTH
Beck
 
Thanks Beck, that worked perfectly!

Kind regards,
Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top