Y
Ynot
I have a form with a listbox on it and an subform. The subform is queried
by the selection in the listbox. All of this works!!
I have added another feature on the form where the rows of the listbox can
be reduced based on a search argument. I.E. if you want only people with
the last name "Smith" in the listbox, you type Smith into a field and click
a search button. I use this to alter the data source of the listbox to
include only items with the name "Smith." That also works perfectly and a
subsequent selection queries the subfiorm and works.
What I want to do is when the results of the search leave only one item in
the listbox, I want that one item to be selected and cause the subform to
requery on that item. I've tried everything and this is what I currently
have that does not work!
If List0.ListCount = 1 Then
List0.Selected(0) = True
Me.RecordsetClone.FindFirst "[ID] = " & Me![List0]
Me.Bookmark = Me.RecordsetClone.Bookmark
Form.Refresh
[FrmMemberData].Requery
End If
What can I do to automatically query the subform if only one item remains in
the listbox??
by the selection in the listbox. All of this works!!
I have added another feature on the form where the rows of the listbox can
be reduced based on a search argument. I.E. if you want only people with
the last name "Smith" in the listbox, you type Smith into a field and click
a search button. I use this to alter the data source of the listbox to
include only items with the name "Smith." That also works perfectly and a
subsequent selection queries the subfiorm and works.
What I want to do is when the results of the search leave only one item in
the listbox, I want that one item to be selected and cause the subform to
requery on that item. I've tried everything and this is what I currently
have that does not work!
If List0.ListCount = 1 Then
List0.Selected(0) = True
Me.RecordsetClone.FindFirst "[ID] = " & Me![List0]
Me.Bookmark = Me.RecordsetClone.Bookmark
Form.Refresh
[FrmMemberData].Requery
End If
What can I do to automatically query the subform if only one item remains in
the listbox??