Jaymin
Registered User.
- Local time
- Tomorrow, 07:19
- Joined
- Oct 24, 2011
- Messages
- 70
Hope you can help,i know this should be simple but it is bugging me,
I have a form with a two cacading combo boxes, i have a button to delete the record, filtered by the second combo box. i use DoCmd.RunCommand acCmdDeleteRecord when the button is clicked.
it delets a record but not the one selected, it deletes the first one in the combo box list
Peter,
I have a form with a two cacading combo boxes, i have a button to delete the record, filtered by the second combo box. i use DoCmd.RunCommand acCmdDeleteRecord when the button is clicked.
it delets a record but not the one selected, it deletes the first one in the combo box list
I have used this option with the same resultPublic Sub cmdExitAndDelete_Click()
On Error GoTo Err_cmdExitAndDelete_Click
If IsNull(cboStation) Then
MsgBox ("You have to enter data first!")
Me.cboStation.SetFocus
Cancel = True
ElseIf IsNull(cboStaff) Then
MsgBox ("You have to enter data first!")
Me.cboStaff.SetFocus
Else
DoCmd.RunCommand acCmdDeleteRecord
DoCmd.Close acForm, "frmDelete_Staff"
End If
Exit_cmdExitAndDelete_Click:
Exit Sub
Err_cmdExitAndDelete_Click:
MsgBox Err.Description
Resume Exit_cmdExitAndDelete_Click e
End Sub
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Peter,

Last edited: