AmyLynnHill
Registered User.
- Local time
- Today, 03:44
- Joined
- Dec 7, 2005
- Messages
- 81
Greetings,
I have a query I want to run on the ON OPEN event of a form. I want it to run only once a day. I have the following code on the ON OPEN event
Private Sub Form_Open(Cancel As Integer)
Dim update As String
update = "Select GDCSearch.LastUpdate from GDCSearch "
If update < Date() Then
DoCmd.OpenQuery "qryGDC"
End If
End Sub
problem is it doesnt run the query. I think (fairly new at VB) it is due to the UPDATE variable is a string and I need to convert it to a date. Any suggestions on the approach or how to convert a string variable to a date?
I have a query I want to run on the ON OPEN event of a form. I want it to run only once a day. I have the following code on the ON OPEN event
Private Sub Form_Open(Cancel As Integer)
Dim update As String
update = "Select GDCSearch.LastUpdate from GDCSearch "
If update < Date() Then
DoCmd.OpenQuery "qryGDC"
End If
End Sub
problem is it doesnt run the query. I think (fairly new at VB) it is due to the UPDATE variable is a string and I need to convert it to a date. Any suggestions on the approach or how to convert a string variable to a date?