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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DatePart to Extract Time...

Status
Not open for further replies.

JJman

Technical User
May 8, 2003
89
IN
I know this can't be that difficult, but I'm trying to put together syntax for the condition of a macro that fires if the current time is before 7:30 a.m. I know it would be something to the effect of &quot; if DatePart(hh;nn;ss, Now())< &quot; ... I hope this makes sense. Can anyone help with the syntax on this? Thanks!




 
try this

If Format(Now, &quot;hh:nn am/pm&quot;) = &quot;07:30 am&quot; Then
'do something here
End If


DougP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top