Keeping track of which listbox has focus: Best approach question
- From: "paul.schrum@xxxxxxxxx" <paul.schrum@xxxxxxxxx>
- Date: Tue, 15 Dec 2009 15:31:48 -0800 (PST)
Access 2007 working in compatibility mode with a 2003 database.
I have three list boxes on a tab page. I also have buttons that
operate based on which list box has focus. So my approach has been to
keep track of which list box has focus by having the following kind of
code in the On Got Focus function of each list box:
Private Sub lbx_suspendedIndefinitely_manageMyTasks_GotFocus()
If Not (IsNull(Me.lbx_suspendedIndefinitely_manageMyTasks)) Then
Set suspendedListBoxWithFocus =
Me.lbx_suspendedIndefinitely_manageMyTasks
End If
End Sub
in which suspendedListBoxWithFocus is global to the form module.
Ultimately the problem I am running in to is that
suspendedListBoxWithFocus has a value of Nothing, so the Set code line
never does anything. I tried putting
suspendedListBoxWithFocus = New ListBox
Set suspendedListBoxWithFocus = Null
in the form's On Open subroutine, but this is also not working.
I think my whole approach must be hopeless. Can anyone suggest a
better approach to finding out which list box had focus just before
the user selected a command button?
- Paul
Schrum
.
- Follow-Ups:
- Re: Keeping track of which listbox has focus: Best approach question
- From: Marshall Barton
- Re: Keeping track of which listbox has focus: Best approach question
- From: Jeff Boyce
- Re: Keeping track of which listbox has focus: Best approach question
- From: Arvin Meyer [MVP]
- Re: Keeping track of which listbox has focus: Best approach question
- Prev by Date: Re: View all – undo combo box filter
- Next by Date: Re: Keeping track of which listbox has focus: Best approach question
- Previous by thread: View all – undo combo box filter
- Next by thread: Re: Keeping track of which listbox has focus: Best approach question
- Index(es):
Relevant Pages
|