Updating Queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have built a query that has a count function for a table. On my
switchboard, the user clicks the button and the query pops up with the
results. If a user enters records that would change the result of the query
how would I update the query so when the user clicks the query button on the
switchboard the new result shows up? For example the table looks like this:

Grade

A
B
C
D
F

The count function would be 5. The user would enter new records and the new
table would look like this:

A
B
C
D
F
A
B

Now the count function would come back as 7. Is there a way to
automatically update the queries as records are entered? Thanks.
 
I'm not sure I'm following ...

Each time a query is run, it checks the table(s) for the current state of
affairs. If you add two records to the underlying table and re-run the
query, it should show the new count.

Or are you saying that you wish to have a control that displays the current
record count? If so, you'll need to tell Access to requery the source for
that control.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
First time I run the query I get a result of 287. I would add 10 records to
the table, but I still get the same result. How would I tell Access to
requery?
 
Sorry, but I'm still not following.

The first time you run the query, you get 287.

Then you add 10 records.

What happens the second time you run the query?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
First time I run the query I get 287.
I add 10 records.
I run the query again and get 287.

Sorry about all the confusion.
 
I run the query and get 287.
I add 10 records.
I run the same query again and still get 287.

Sorry about the confusion.
 
Please post the SQL of the query. It is most unusual for a query to NOT see
the new data.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
SELECT Count(panel_ledge.[Panel Number]) AS [Count Of Panel Numbers],
Count(panel_ledge.[Ledge clean date]) AS [Count Of Ledge Cleaning],
Count(panel_bulk.[Bulk Switch Date]) AS [Count Bulk Switch],
Count(panel_uv.[UV ad Date]) AS [Count Of UV ad], Count(panel_back.[Backpaint
Date]) AS [Count Of Backpaint], Count(panel_qc.[QC Date]) AS [Count Of QC]
FROM (((panel_ledge INNER JOIN panel_bulk ON panel_ledge.[Panel
Number]=panel_bulk.[Panel Number]) INNER JOIN panel_back ON
panel_ledge.[Panel Number]=panel_back.[Panel Number]) INNER JOIN panel_qc ON
panel_ledge.[Panel Number]=panel_qc.[Panel Number]) INNER JOIN panel_uv ON
panel_ledge.[Panel Number]=panel_uv.[Panel Number];
 
So, I count at least 5 different tables. Which one(s) is getting the new
record(s)?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Chinny03 said:
SELECT Count(panel_ledge.[Panel Number]) AS [Count Of Panel Numbers],
Count(panel_ledge.[Ledge clean date]) AS [Count Of Ledge Cleaning],
Count(panel_bulk.[Bulk Switch Date]) AS [Count Bulk Switch],
Count(panel_uv.[UV ad Date]) AS [Count Of UV ad],
Count(panel_back.[Backpaint
Date]) AS [Count Of Backpaint], Count(panel_qc.[QC Date]) AS [Count Of QC]
FROM (((panel_ledge INNER JOIN panel_bulk ON panel_ledge.[Panel
Number]=panel_bulk.[Panel Number]) INNER JOIN panel_back ON
panel_ledge.[Panel Number]=panel_back.[Panel Number]) INNER JOIN panel_qc
ON
panel_ledge.[Panel Number]=panel_qc.[Panel Number]) INNER JOIN panel_uv ON
panel_ledge.[Panel Number]=panel_uv.[Panel Number];

Jeff Boyce said:
Please post the SQL of the query. It is most unusual for a query to NOT
see
the new data.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
It varies what table gets the new record. When a certain process is done a
record is added.

Jeff Boyce said:
So, I count at least 5 different tables. Which one(s) is getting the new
record(s)?

Regards

Jeff Boyce
Microsoft Office/Access MVP

Chinny03 said:
SELECT Count(panel_ledge.[Panel Number]) AS [Count Of Panel Numbers],
Count(panel_ledge.[Ledge clean date]) AS [Count Of Ledge Cleaning],
Count(panel_bulk.[Bulk Switch Date]) AS [Count Bulk Switch],
Count(panel_uv.[UV ad Date]) AS [Count Of UV ad],
Count(panel_back.[Backpaint
Date]) AS [Count Of Backpaint], Count(panel_qc.[QC Date]) AS [Count Of QC]
FROM (((panel_ledge INNER JOIN panel_bulk ON panel_ledge.[Panel
Number]=panel_bulk.[Panel Number]) INNER JOIN panel_back ON
panel_ledge.[Panel Number]=panel_back.[Panel Number]) INNER JOIN panel_qc
ON
panel_ledge.[Panel Number]=panel_qc.[Panel Number]) INNER JOIN panel_uv ON
panel_ledge.[Panel Number]=panel_uv.[Panel Number];

Jeff Boyce said:
Please post the SQL of the query. It is most unusual for a query to NOT
see
the new data.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Back
Top