I set this code up to load a table based on beginning ending dates, I thought it was working...then I realized is I enter a begin date where the DAY is a single digit ( 1-9) it mixes it up as a month so where Dec 1/09 is entered it turns it into Jan 12/09?
Seems basic, and I'm being lazy by posting because it is probably staring at me in the face....
thanks for looking
Seems basic, and I'm being lazy by posting because it is probably staring at me in the face....
Code:
Public Sub Update()
Dim strSQL As String
Dim stDate As Date
Dim EnDate As Date
stDate = Me.txtDate
DoCmd.OpenQuery "qryDelete_tblRunDate"
If IsNull(Me.txtEndDate) Then
EnDate = Me.txtDate + 1
Else
EnDate = Me.txtEndDate
End If
Do Until stDate = EnDate
strSQL = "insert into tblRundate(rundate,systemID,Client)"
strSQL = strSQL + "Values(" & "#" & stDate & "#" & "," & "'" & Me.txtComp & "'" & "," & "'" & Me.txtClient & "'" & ")"
'strSQL = "INSERT INTO tblRunDate (RunDate) values (#25-Jun-2009#)"
DoCmd.RunSQL strSQL
stDate = stDate + 1
Loop
Me.Requery
End Sub
thanks for looking