Microsoft
Software
Hardware
Network
Question : if statement in a macro
Can you write an if statement in a macro-
I have tried If TimeValue(Now)) Between #01:00# and #9:00# then
docmd.Openquery "qryUpdate1"
ElseIf TimeValue(Now()) Between #1:00# and 9:00# then
docmd.Openquery "qryUpdate2"
EndIf
I want first update between 1 and 9 am
and the second update between 1 and 9 pm
also do not think my code is right.
thank you
Answer : if statement in a macro
Between doesn't work in VBA, try this instead
If Hour(Now()) >= 1 And Hour(Now()) < 9 Then
DoCmd.OpenQuery "qryUpdate1"
ElseIf Hour(Now()) >= 13 And Hour(Now()) < 21 Then
DoCmd.OpenQuery "qryUpdate2"
End If
Random Solutions
XP 10 inbound connection limit question
Windows server 2003 terminal users unable to view png images in IE
How to Determine what SQL Databases are Installed & Running?
Still having issues pinging from one subnet to another through ASA 5510
MS-Access doesn't recognize all rows in text file ...
Win XP freezes after installing my Asus P6X58D mobo
Google Analytics
Cost of CAT5e cable installation
BGINFO via GPO server 2008, error loading bgi file even though its all loaded correctly
How come when I do a copy run start, my config is always gone after a reload???