So, I'm almost there on this form. The form that calls this little popup for the user to enter dates has the txtAir_Dates on it that the simpleCSV function eventually when the popup is closed.
Sometimes, the user won't have to be opening the dialog to enter dates because there is only one. So if the popup isn't necessary, I want to use an INSERT INTO to add the date to the dates table.
Here is my code. There's a problem with my StrSQL. It runs all the way through the MsgBox statement but the record hasn't been added.
MIB1019
Sometimes, the user won't have to be opening the dialog to enter dates because there is only one. So if the popup isn't necessary, I want to use an INSERT INTO to add the date to the dates table.
Here is my code. There's a problem with my StrSQL. It runs all the way through the MsgBox statement but the record hasn't been added.
MIB1019
Code:
'write start/end date to IODetailDates table
Dim StrSQL As String
Dim DetailID As Long
Dim StartDate as Date
DetailID = Me.txtDetailID
StartDate = Me.txtStartDate
Debug.Print StartDate
Debug.Print DetailID
StrSQL = "INSERT INTO tblIODetails_Dates (Detail_ID, Air_Date) VALUES (DetailID , StartDate);"
Debug.Print StrSQL
DoCmd.SetWarnings False
DoCmd.RunSQL StrSQL
DoCmd.SetWarnings True
Me.txtAirDates = Format(StartDate, "m/d")
MsgBox StartDate & " added to Air Dates list."