D
Dani Green via AccessMonster.com
I have a combo box that when clicked will filter records based on the
companyid.
On this same form, I have a list box. I need the list box to list only the
records based off the combo box AfterUpdate click, but my code is not
working. The combo is "Combo170" and the List is "List195". Here's my code:
Private Sub Combo170_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Companyid] = " & Str(Nz(Me![Combo170], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Dim sFilter As String
sFilter = [CompanyName]
Me!Label90.Caption = sFilter
Me!List195.RowSource = [Companyid]
Me.List195.Requery
End Sub
Thanks for your help,
Dani
companyid.
On this same form, I have a list box. I need the list box to list only the
records based off the combo box AfterUpdate click, but my code is not
working. The combo is "Combo170" and the List is "List195". Here's my code:
Private Sub Combo170_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Companyid] = " & Str(Nz(Me![Combo170], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
Dim sFilter As String
sFilter = [CompanyName]
Me!Label90.Caption = sFilter
Me!List195.RowSource = [Companyid]
Me.List195.Requery
End Sub
Thanks for your help,
Dani