A
Asif
Hi, I have a form with a listbox below is a command button
cmdDeleteRecord which the user clicks and it will open up another form
with details of the entry in the listbox highlighted. What I want to
do is when no entry is highlighted in the listbox and the user clicks
on the command button then an error message appears saying "Please
choose and entry from the list".
I've tried the following code but unfortunately when an entry is
selected the error message still comes up and the form doesn't load.
Private Sub cmdDeleteRecord_Click()
On Error GoTo Err_cmdDeleteRecord_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "2 -c CANCELJOB"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Err_cmdDeleteRecord_Click:
MsgBox "Please Choose and Entry from Cable End Skip!", 777,
"Information Missing"
End Sub
Any Suggestions as to what I'm doing wrong??
Thanks
cmdDeleteRecord which the user clicks and it will open up another form
with details of the entry in the listbox highlighted. What I want to
do is when no entry is highlighted in the listbox and the user clicks
on the command button then an error message appears saying "Please
choose and entry from the list".
I've tried the following code but unfortunately when an entry is
selected the error message still comes up and the form doesn't load.
Private Sub cmdDeleteRecord_Click()
On Error GoTo Err_cmdDeleteRecord_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "2 -c CANCELJOB"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Err_cmdDeleteRecord_Click:
MsgBox "Please Choose and Entry from Cable End Skip!", 777,
"Information Missing"
End Sub
Any Suggestions as to what I'm doing wrong??
Thanks