A
Andy6
Can anyone see why my Update query doesn't Update the table 'DiaryDates'
This function is called on the 'ON EXIT' event of each text box on my 8 day
diary form. Using a break point I can see that all the correct values are in
strNote and strDate but it still doesn't update my table. Code is as follows:
Public Function UpdateDiary()
On Error Resume Next
Dim strSQL As String
Dim strNote As String, strDate As Date
Dim db As DAO.Database, qd As DAO.QueryDef
Dim F%
Set db = CurrentDb
strSQL = "UPDATE Diarydates SET DiaryNote = strNote WHERE DiaryDate =
strDate"
For F = 1 To 8
strDate = Forms![Diary]("Dt" & F)
strNote = Forms![Diary]("Note" & F)
Set qd = db.CreateQueryDef("UpdtDiaryNte", strSQL)
qd.Execute
qd.Close
Next F
End Function
Any help would be much appreciated,
Many Thanks in advace, Andy
This function is called on the 'ON EXIT' event of each text box on my 8 day
diary form. Using a break point I can see that all the correct values are in
strNote and strDate but it still doesn't update my table. Code is as follows:
Public Function UpdateDiary()
On Error Resume Next
Dim strSQL As String
Dim strNote As String, strDate As Date
Dim db As DAO.Database, qd As DAO.QueryDef
Dim F%
Set db = CurrentDb
strSQL = "UPDATE Diarydates SET DiaryNote = strNote WHERE DiaryDate =
strDate"
For F = 1 To 8
strDate = Forms![Diary]("Dt" & F)
strNote = Forms![Diary]("Note" & F)
Set qd = db.CreateQueryDef("UpdtDiaryNte", strSQL)
qd.Execute
qd.Close
Next F
End Function
Any help would be much appreciated,
Many Thanks in advace, Andy