snow-raven
Registered User.
- Local time
- Yesterday, 22:42
- Joined
- Apr 12, 2018
- Messages
- 48
I have an unbound form with unbound lookup boxes looking up from several tables/queries. The lookup functions are correctly returning a visible in my list boxes, but I can't seem to grab that list box values to use in my code unless I select the list box with the mouse.
Selecting in either of the 'Look up' combo boxes correctly updates the corresponding list box to the right.
For example, the first Accepted Name list box populates during the AfterUpdate event of the combo box using Me.WhichAcName.Requery. The RowSource for that list box is: "SELECT my_List.my_Scientific_Name FROM my_List INNER JOIN DB_Species_Synonyms ON my_List.my_ID = my_Synonyms.my_ID WHERE (((my_Synonyms.Syn_Mis_Err)=[Forms].[Dashboard].[Syn_Lookup])); "
I want to use the Accepted Name value in another field lookup, but the value will not update until I physically select the list box content with the mouse. I've tried forcing this by using SetFocus or requerying on the list box GotFocus event, but nothing will get the value to update except the mouse.
Here you can see some of my 7 million experiments:
After a bunch of experiements that only returned Null values, I happened to click inside the box & started getting at least a name, but it won't update until I click in the box again. SetFocus does not have the same results. What the heck do I need to do differently?
Selecting in either of the 'Look up' combo boxes correctly updates the corresponding list box to the right.
For example, the first Accepted Name list box populates during the AfterUpdate event of the combo box using Me.WhichAcName.Requery. The RowSource for that list box is: "SELECT my_List.my_Scientific_Name FROM my_List INNER JOIN DB_Species_Synonyms ON my_List.my_ID = my_Synonyms.my_ID WHERE (((my_Synonyms.Syn_Mis_Err)=[Forms].[Dashboard].[Syn_Lookup])); "
I want to use the Accepted Name value in another field lookup, but the value will not update until I physically select the list box content with the mouse. I've tried forcing this by using SetFocus or requerying on the list box GotFocus event, but nothing will get the value to update except the mouse.
Here you can see some of my 7 million experiments:
Code:
'----------------------------------------------------------------------------------------------------------------
Private Sub Syn_Lookup_AfterUpdate()
'Debug.Print Me.WhichAcName.Value
'Debug.Print Me.WhichAcName.OldValue
'Debug.Print Me.WhichAcName.RowSource
'Debug.Print Me.WhichAcName.Column(0)
'Debug.Print Me.WhichAcName.Column(0, WhichAcName.ItemsSelected)
Me.WhichAcName.Requery
Me.WhichAcName.SetFocus
'Me.Repaint
Debug.Print Me.WhichAcName.Value
'Debug.Print Me.WhichAcName.Value
'Debug.Print Me.WhichAcName.OldValue
'Debug.Print Me.WhichAcName.RowSource
'Debug.Print Me.WhichAcName.Column(0)
'Debug.Print Me.WhichAcName.Column(0, WhichAcName.ItemsSelected)
End Sub
'----------------------------------------------------------------------------------------------------------------
'Private Sub WhichAcName_AfterUpdate()
'Debug.Print Me.WhichAcName.Value
'End Sub
'----------------------------------------------------------------------------------------------------------------
Private Sub WhichAcName_GotFocus()
Me.WhichAcName.Requery
Debug.Print Me.WhichAcName.Value
End Sub
After a bunch of experiements that only returned Null values, I happened to click inside the box & started getting at least a name, but it won't update until I click in the box again. SetFocus does not have the same results. What the heck do I need to do differently?