In Access 97, I have frmAddNewTrainNo with lbxLastTrainNo that gets its data from tblTrainNoQuery. The form also has cbxTrainNo where new TrainNo's are added.
How do I re-run my query tblTrainNoQuery when the cmdAddRecord button is clicked so that lbxLastTrainNo will update with the just added TrainNo?
Here is code for the cmdAddRecord buttom.
Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAddRecord_Click:
Exit Sub
Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click
End Sub
I have tried using frmAddNewTrainNo.Form.Requery and frmAddNewTrainNo.Refresh.
Thanks, Brian
How do I re-run my query tblTrainNoQuery when the cmdAddRecord button is clicked so that lbxLastTrainNo will update with the just added TrainNo?
Here is code for the cmdAddRecord buttom.
Private Sub cmdAddRecord_Click()
On Error GoTo Err_cmdAddRecord_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAddRecord_Click:
Exit Sub
Err_cmdAddRecord_Click:
MsgBox Err.Description
Resume Exit_cmdAddRecord_Click
End Sub
I have tried using frmAddNewTrainNo.Form.Requery and frmAddNewTrainNo.Refresh.
Thanks, Brian