I have have two list boxes. One is a listing of all possible variables.
We'll call this listbox A. The other is a listing of all the selected
variables. We'll call this listbox B. If a person double-clicks on one of
the variables in listbox A it "moves" it to listbox B. What is going on
behind the scenes is that the table that holds all these variables has a
yes/no field call Print. When the user double clicks on the value it fires
a db.execute statement which is an Update SQL statement to put it in the
right state, either yes or no. This all works fine and dandy. What I'm
having a problem with though is that based on what values are chosen (those
in listbox B) other textboxes and option groups become enabled or disabled.
I put some code in the After Update event of listbox B which goes like this:
Private Sub lstPatronTypesInclude_AfterUpdate()
For x = 0 To lstPatronTypesInclude.ListCount
If Me!lstPatronTypesInclude.ItemData(x) = 6 Then
txtMembershipExpiredFrom.Enabled = True
Exit Sub
Else
txtMembershipExpiredFrom.Enabled = False
End If
Next x
End Sub
The problem is is that it only fires when I've clicked back onto listbox B.
So I could click away and all the variables I want, but if I don't click
onto listbox B, the other text boxes on the form don't change to enabled or
disabled. Is there a way to get this to happen or am I gooing about this
the entirely wrong way?
TIA,
Bill