Form does not filter

Leesha
BronzeLounger
Posts: 1488
Joined: 05 Feb 2010, 22:25

Form does not filter

Post by Leesha »

Hi,

I don't know what I'm doing wrong. I have a form that needs to filter based on the txtFilter, however its not doing it. I've used this set up more times than I can count so its really frustrating to me as to why its not working. I'm attaching the file here. It's probably something simple that will make me want to kick myself, but I just can't find it.
Thanks,
Leesha
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Form does not filter

Post by HansV »

You should refer to the list box on the switchboard form instead of to a text box on the customer form itself - that text box hasn't been filled yet when the form is being loaded. Change the record source of the customer form to

SELECT * FROM tblCustomerDemographics WHERE CustomerID=[Forms]![frmSalesSwitchboard]![lstCustomername]
Best wishes,
Hans

Leesha
BronzeLounger
Posts: 1488
Joined: 05 Feb 2010, 22:25

Re: Form does not filter

Post by Leesha »

Now I'm really confused. I had tried that as its the way I normally do it but it didn't work. The only thing I did differently is that instead of Select * I had each control listed. Then again that is how I always do it. I even copied and pasted the filter control name in case it was a spelling error. It still didn't work. That is when I tried using a control on the form itself vs using the control in the list. Soooo confused. But its working and that is all that matters.

Thanks Hans,
Leesha

User avatar
HansV
Administrator
Posts: 78523
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Form does not filter

Post by HansV »

I can't explain why it didn't work before. It shouldn't matter whether you use * or enumerate all fields. I just used * to shorten the text in my post.
Best wishes,
Hans