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
Exchange 2007 OWA causes 2 audit failures on failed login attempt
net share system error 5 acces denied
PHP error reporting
Deploy application using GPO win 2008 R2
Source: NETLOGON Event ID: 5773 error with in DNS
Opera Version 10.60 page cache(!?) problem
Exchange 2003 Logical Size vs Physical Size
VS 2008: access rights under windows 7 when building an assembly
Crystal Reports Xi - Sorting a CrossTab Report by a Summary Field
How Do I run a specific fix and test in ISINTEG