Filter issues, please help!

G

Gina Whipp

Hello All,

I have a filter that runs once the combo box is updated. I get the message
No FIlter but the filter itself does not work. Can someone tell me what I
am missing. Oh, when you open the form it is not filtered.

Thanks for any and all help...
Gina

Sub Form_Open(Cancel As Integer)

Me!cboListTypeID.RowSource = "SELECT tblListingType.ltListingTypeID,
tblListingType.ltListingTypeName FROM tblListingType WHERE
(((tblListingType.ltListingTypeID)=""A"" Or
(tblListingType.ltListingTypeID)=""M""));"


Sub cboListTypeID_AfterUpdate()
'On Error Resume Next
Dim strFilterSQL As String

If Not Me.cboListTypeID = "" Then
Select Case cboListTypeID
Case "A"
strFilterSQL = ""
MsgBox "No Filter"
Case "M"
strFilterSQL = "[btBrokerID] = Forms![frmLogOn]![cboLoginID]"
Me.Form.AllowAdditions = False
Case Else
strFilterSQL = "[llListingTypeID] = '" & cboListTypeID & "'"
Me.Form.AllowAdditions = False
End Select
End If

Me.FilterOn = True
Me.Filter = strFilterSQL
Me.Requery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top