A
Asif
Hi all
I have two listbox's in my form and they are both run from two
different queries. Below each listbox is a command button (Delete)
used to delete an entry in the listbox.
Now behind the command button for listbox 1 I have the following code;
If Nz(Me!List1, "") = "" Then
MsgBox "Nothing Selected"
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "8-b COPPERBINDELETE"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
Now If I don't click a selection from listbox 1 then an error message
appears saying "Nothing selected" now I've tried to apply the same
code to the command button of listbox 2 but it doesn't work
If Nz(Me!List2, "") = "" Then
MsgBox "Nothing Selected"
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "9-b GENERALBINDELETE"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
The code continues to run even if nothing is selected from listbox 2.
Any ideas why this is happening and how to go about resolving this
issue?
Thanks
I have two listbox's in my form and they are both run from two
different queries. Below each listbox is a command button (Delete)
used to delete an entry in the listbox.
Now behind the command button for listbox 1 I have the following code;
If Nz(Me!List1, "") = "" Then
MsgBox "Nothing Selected"
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "8-b COPPERBINDELETE"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
Now If I don't click a selection from listbox 1 then an error message
appears saying "Nothing selected" now I've tried to apply the same
code to the command button of listbox 2 but it doesn't work
If Nz(Me!List2, "") = "" Then
MsgBox "Nothing Selected"
Else
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "9-b GENERALBINDELETE"
stLinkCriteria = "[BINPROCESSID]=" & Me![txtBinProcessID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
End Sub
The code continues to run even if nothing is selected from listbox 2.
Any ideas why this is happening and how to go about resolving this
issue?
Thanks