Solved Listbox selection does not update form

ClaraBarton

Registered User.
Local time
Today, 09:20
Joined
Oct 14, 2019
Messages
584
I have a listbox with a FAYT select combo. When a record is chosen in the listbox from the combo, I'd like another subform to update from that selection. I've tried to requery the form but the subform will not update untill I actually click on the list box record. Is there something I'm missing here?
Code:
Private Sub cboSearch_AfterUpdate()
   Dim lngID As Long
    lngID = Nz(Me.cboSearch)
   
    If cboSearch > 0 Then
        Me!lstEditList.Value = lngID
        Me!lstEditList.SetFocus
'        Me!lstEditList.Selected(lngID) = True
'        Me.Requery
    End If
   
    Me.cboSearch = Null
    Me.cboSearch.Requery
           
End Sub
 
How can you expect the subform to update based upon a selection if you haven't selected anything in the combobox yet? ACCESS is good but it's not clairvoyant.
 
You don't seem to requery the subform after you pass the value to the listbox (Me.sfrmYourSubform.Form.Requery).

Cheers,
 
Open List Maintenance from the opening menu.
It's been selected from the combo. It's highlighted. I want to update the form from that highlighted record without clicking on it.
 

Attachments

Users who are viewing this thread

Back
Top Bottom