Hi,
I am running the following code that should update a table after a command button is pressed:
Unfortunately this is not working properly. When I click the save button, the table does not update and I dont get any errors.
Anyone see anything suspect?
I am running the following code that should update a table after a command button is pressed:
Code:
Private Sub cmdSaveReservation_Click()
On Error GoTo cmdSaveReservation_Click_Err
On Error Resume Next
Dim strSQL As String
strSQL = "UPDATE tblReservations SET tblReservations.CategoryID =" & _
"[Forms]![frmReservations]![txtCategoryID], tblReservations.Portfolio = [Forms]![frmReservations]![chkPortfolio] " & _
"WHERE (((tblReservations.ReservationID)=[Forms]![frmReservations]![TxtReservationID]))"
CurrentDb.Execute strSQL, dbFailOnError
' Lock all controls
Call LockResControls
Me.Requery
DoCmd.RunCommand acCmdSaveRecord
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
DoCmd.GoToRecord , "", acLast
cmdSaveReservation_Click_Exit:
Exit Sub
cmdSaveReservation_Click_Err:
MsgBox Error$
Resume cmdSaveReservation_Click_Exit
End Sub
Unfortunately this is not working properly. When I click the save button, the table does not update and I dont get any errors.
Anyone see anything suspect?