G
Guest
Hi all
I have an MS Access form with the following objects
ListBox with visible set to false, populated by a query and on timer event
set to requery at 5000 milliseconds.
A button which makes the ListBox visible and deselects any selected items
A button which sets ListBox visible back to false.
Code snippet for button one:
Private Sub btnAssignSingle_Click()
Dim i As Integer
Me!lstEmptySlotsSingle.Visible = True
For i = 0 To lstEmptySlotsSingle.ListCount - 1
Me.lstEmptySlotsSingle.Selected(i) = False
Next
End Sub
Code snippet for button two as follows
Private Sub btnCancel_Click()
Me!lstEmptySlotsSingle.Visible = False
End Sub
Code snippet for ListBox on timer as follows
Private Sub Form_Timer()
Me!lstEmptySlotsSingle.Requery
End Sub
My problem : well button one makes the list box visible as required. My
user selects an item ..... then decides not to proceed with the action on
that selection and clicks button two. When the user clicks button one again
the list box becomes visible, the previously selected item is de-selected as
required by the code ...... BUT ..... at the next on timer event when the
list box is requeried the previously de-selected item becomes selected again!!
Where am i going wrong with this. I'd appreciate any help..... and hope I
have explained it properly.
WinXP and MS Office 2000
Regards
Michael Bond
I have an MS Access form with the following objects
ListBox with visible set to false, populated by a query and on timer event
set to requery at 5000 milliseconds.
A button which makes the ListBox visible and deselects any selected items
A button which sets ListBox visible back to false.
Code snippet for button one:
Private Sub btnAssignSingle_Click()
Dim i As Integer
Me!lstEmptySlotsSingle.Visible = True
For i = 0 To lstEmptySlotsSingle.ListCount - 1
Me.lstEmptySlotsSingle.Selected(i) = False
Next
End Sub
Code snippet for button two as follows
Private Sub btnCancel_Click()
Me!lstEmptySlotsSingle.Visible = False
End Sub
Code snippet for ListBox on timer as follows
Private Sub Form_Timer()
Me!lstEmptySlotsSingle.Requery
End Sub
My problem : well button one makes the list box visible as required. My
user selects an item ..... then decides not to proceed with the action on
that selection and clicks button two. When the user clicks button one again
the list box becomes visible, the previously selected item is de-selected as
required by the code ...... BUT ..... at the next on timer event when the
list box is requeried the previously de-selected item becomes selected again!!
Where am i going wrong with this. I'd appreciate any help..... and hope I
have explained it properly.
WinXP and MS Office 2000
Regards
Michael Bond