Hi. I would like to have an error message appear if my Form frmReservation combo box field cboLookResID
cannot find a reservationID.
I currently use just the 3 lines that start with the me.refresh in the afterUpdate.
All works fine to retrieve a valid reservationID. However, If I enter a bogus reservationID
into the cboLookResID lookup field, i just get whatever record i was last on. I would like to
get a message saying that the ReservationID cannot be found. I am worried that I will start
typing into an existing unrelated record and mess it up.
Maybe I am close with the code below? Regards, Cimoli.
=============================================================
Private Sub cboLookResID_AfterUpdate()
On Error GoTo Err_cmdLookResID_Click
Me.Refresh
DoCmd.GoToControl Me.ReservationID.Name
DoCmd.FindRecord Me.cboLookResID
Exit_cmdLookResID_Click:
Exit Sub
Err_cmdLookResID_Click:
'MsgBox Err.Description
MsgBox "ResID not found. Please retry."
Resume Exit_cmdLookResID_Click
End Sub
=====================================================
cannot find a reservationID.
I currently use just the 3 lines that start with the me.refresh in the afterUpdate.
All works fine to retrieve a valid reservationID. However, If I enter a bogus reservationID
into the cboLookResID lookup field, i just get whatever record i was last on. I would like to
get a message saying that the ReservationID cannot be found. I am worried that I will start
typing into an existing unrelated record and mess it up.
Maybe I am close with the code below? Regards, Cimoli.
=============================================================
Private Sub cboLookResID_AfterUpdate()
On Error GoTo Err_cmdLookResID_Click
Me.Refresh
DoCmd.GoToControl Me.ReservationID.Name
DoCmd.FindRecord Me.cboLookResID
Exit_cmdLookResID_Click:
Exit Sub
Err_cmdLookResID_Click:
'MsgBox Err.Description
MsgBox "ResID not found. Please retry."
Resume Exit_cmdLookResID_Click
End Sub
=====================================================