how do text boxes on forms work

J

jackie

Hi,
Tuesday, they did a microsoft upgrade, and my access file was corrupted. So
now I have go go back and recreate the queries that are the source for my
command buttons. The user can enter search criteria in text boxes, and the
command button will filter for only that data. For example, the user can
enter "Profit Center" MEDICAL, and they will only get sales data for MEDICAL.
I have gone in and recreated the query, but I cannot get it to filter for a
profit center. This form has twotabs, one for IMCOM, and one for CENTCOM.

The only changes I have made from the first tab which worked fine to the
second tab is I have given the text boxes on the two tabs different names.
The text boxes on the IMCOM tab are named 'profit center', 'FSC', and the
boxes on the CENTCOM tab are named 'profit_Center_2", 'FSC_2". Otherwise the
data I enter on IMCOM is automatically entered on the CENTCOM.

The query brings back all of the sales data, but when I try to use it in the
form, I cannot filter for anyting. So, I need to know how these forms work.
What in the code makes it filter. Here's the code I am using. And is my join
a problem. I used the join because the sales table has all of the sales, and
the dodaac table has only those customers realted to Centcom. Thanks.

SELECT sales08.dodaac, sales08.[Profit Center], sales08.Sales,
sales08.line1, sales08.state, sales08.zip
FROM sales08 INNER JOIN Centcom_dodaacs ON sales08.dodaac =
Centcom_dodaacs.Dodaac
WHERE ((sales08.[Profit Center] Like "*" &
[Forms]![QBF_form]![supply_chain] & "*") OR
([Forms]![QBF_form]![supply_chain] IS NULL))
AND
((sales08.DoDAAC Like "*" & [Forms]![QBF_form]![dodaac] & "*") OR
([Forms]![QBF_form]![dodaac] IS NULL))


P.S.
I know my naming convention stinks. I just couldn't come up with one that
was intuitive, and now that I've started, I'm afraid to go back and make
changes.
 
K

Klatuu

I had exactly the same problem. An upgrade was done Tuesday night and
yesterday my boss was demoing the new system to the company owner and all the
reports stopped working. I experienced the problem with filtering on some
but not all. In once case it should filter on calendar quarter. I got all
the records I should have, but all said they were quarter 4. Some of my
queries came back with a message the queries were too complex to be evaluated.

What I had to do was rewrite all the queries to make them work correctly.
Can't say exactly what fixed it, but that is what I had to do.
 

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