Problem with date portion of this code.

mshelley1

Carbo
Local time
Today, 08:39
Joined
Feb 12, 2006
Messages
45
The follow vba code fine except for the date portion, it should only run after July 1st of each year. So the date portion is apparently not coded correctly. Can anyone help?

Private Sub Command0_Click()

If IsNull(DLookup("Name", "Count_CreditDef", "")) = False And Date >= 7 / 1 / Format(Now(), "yyyy") Then
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Delnotice"
DoCmd.OpenForm stDocName, , , stLinkCriteria




End If
End Sub
 
There's a couple of things wrong with that. This would be simpler:

...And Month(Date()) > 6
 

Users who are viewing this thread

Back
Top Bottom