J
JamesJ
I'm using the following code in thge AfterUpdate of a Listbox
to filter records in another Listbox:
If Me!lstContactFilter.Column(1) = "<<All>>" Then
strAll = "SELECT ContactID, Listing, Phone, ContactType, Notes FROM
tblContactType" _
& vbCrLf & "INNER JOIN tblContacts ON
tblContactType.ContactTypeID = tblContacts.ContactTypeID ORDER BY Listing;"
Me.RecordSource = strAll
Me!lstContacts.RowSource = Me.RecordSource
Else
strSql = "SELECT ContactID, Listing, Phone, ContactType, Notes FROM
tblContactType" _
& vbCr & "INNER JOIN tblContacts ON tblContactType.ContactTypeID
= tblContacts.ContactTypeID WHERE (((tblContacts.ContactTypeID)=" &
[lstContactFilter].[Value] & "))ORDER BY Listing;"
Me.RecordSource = strSql
Me!lstContacts.RowSource = Me.RecordSource
End If
The problem is that after the records get filtered the selected value in
lstContactFilter becomes unselected. What might I do to keep the
selected item 'highlighted?'
Thanks,
James
to filter records in another Listbox:
If Me!lstContactFilter.Column(1) = "<<All>>" Then
strAll = "SELECT ContactID, Listing, Phone, ContactType, Notes FROM
tblContactType" _
& vbCrLf & "INNER JOIN tblContacts ON
tblContactType.ContactTypeID = tblContacts.ContactTypeID ORDER BY Listing;"
Me.RecordSource = strAll
Me!lstContacts.RowSource = Me.RecordSource
Else
strSql = "SELECT ContactID, Listing, Phone, ContactType, Notes FROM
tblContactType" _
& vbCr & "INNER JOIN tblContacts ON tblContactType.ContactTypeID
= tblContacts.ContactTypeID WHERE (((tblContacts.ContactTypeID)=" &
[lstContactFilter].[Value] & "))ORDER BY Listing;"
Me.RecordSource = strSql
Me!lstContacts.RowSource = Me.RecordSource
End If
The problem is that after the records get filtered the selected value in
lstContactFilter becomes unselected. What might I do to keep the
selected item 'highlighted?'
Thanks,
James