yippie_ky_yay
Registered User.
- Local time
- Today, 16:56
- Joined
- Jul 30, 2002
- Messages
- 338
Hello all,
I have a bit of a confusing problem! One of my subforms has a listbox displaying n record(s). I require the user to select a record on the listbox by single or double cliking and then, if they want to delete it, they just hit the Delete command button I created.
This works great unless they forget to select a record first before trying to delete it. I tried putting in a check like this:
If IsNull(lstboxGroups) Then
MsgBox "Please select an item from the listbox to delete."
Exit Sub
Else
...go on and delete the record
Now the weird part - this seemed to work for awhile, then the msgbox started popping up even when I did select a record. To solve this I added "Not" infront of the IsNull test and that seemed to work for awhile - until it happened again! It keeps flipping between the two it seems. Does anyone know why the test criteria would keep reversing?
(I should mention that I did solve this by not enabling the Delete button until the user selects an item - I'm just curious about the test behaviour)
Thanks,
-Sean
I have a bit of a confusing problem! One of my subforms has a listbox displaying n record(s). I require the user to select a record on the listbox by single or double cliking and then, if they want to delete it, they just hit the Delete command button I created.
This works great unless they forget to select a record first before trying to delete it. I tried putting in a check like this:
If IsNull(lstboxGroups) Then
MsgBox "Please select an item from the listbox to delete."
Exit Sub
Else
...go on and delete the record
Now the weird part - this seemed to work for awhile, then the msgbox started popping up even when I did select a record. To solve this I added "Not" infront of the IsNull test and that seemed to work for awhile - until it happened again! It keeps flipping between the two it seems. Does anyone know why the test criteria would keep reversing?
(I should mention that I did solve this by not enabling the Delete button until the user selects an item - I'm just curious about the test behaviour)
Thanks,
-Sean
Last edited: