One Query based on many Queries

  • Thread starter Thread starter hashdove
  • Start date Start date
H

hashdove

Guest
Please please answer pleaes. One Query based on many Queries

Hi all,

I have made a query based 4 Queries and result is shown in Form. However, i have made no joints between the queries. Just selected different fields from each query. But, sometimes one of the queries do not have any result to show. In such a case my Form do not perform the calculation and shows no result.

Is there any method i can solve this problem? Please help me.........

Thanks
 
Last edited:
What is the calculation?

In such a case my Form do not perform the calculation and shows no result.

can you show the calculation that is performed?

thanks, since the query can't be forced to return something, then the solution is in the calculation.

sg
 
Last edited:
I would suggest making a relationship between these tables (if possible). I would create an outer join betweem the tables, to have all data from Table 1 and the corresponding data from Table 2.

To do this, go in the query design window. Right click on the relationship.
 
Variable use with Query and report

I use a variable to select records in a query. I enter the variable when the query runs and also have to enter the variable when I use that query results for a report. I want to enter the variable only once when I run the query and not at the report time.

How do I eliminate the request for the variable during the report generation for the user?

Thanks,

Don white
 
Don White said:
I use a variable to select records in a query. I enter the variable when the query runs and also have to enter the variable when I use that query results for a report. I want to enter the variable only once when I run the query and not at the report time.

How do I eliminate the request for the variable during the report generation for the user?

Thanks,

Don white
You should have started a new thread for your question as it is unrelated to the original thread.


You can put a text box on a form for the user to enter the parameter value for the query and report. Then in the query criteria, reference the text box like this:-

[Forms]![formName]![textboxName]


You can then run the report and the query from two command buttons on the form. This way, the user needs to enter the value only once in the text box for the report as well as the query. The form must be open when the report or the query is run.


Note: You can run the report independently. You don't need to open the query on which the report is based.
.
 
Last edited:
close query with macro does not work, why

I need to close a querywith the close macro command. It will not close the query. I do not want the user to close it. Why does the close query not work??

Thanks,

Don
 
close query with macro does not work, why

Start a new thread as this is a new issue.
Ignoring this forum rule will most likely result in your questions to be ignored.

RV
 
Close macro

I still need to close a query using the close macro. The close macro does not close my query. Why???

How can I close a query using the close macro?
 
union query and regular query error

I have one union query made by SQL language in microsoft access and the other query made by query by microsoft access.

I sum the union SQL on a field and get 2008
I sum on the other query and get 2007.

The two queries have 24 records each and I have added the sum fields up with a calculator and get 2008. I have added them many times and still get 2008.

However, when I sum the fields with the sum function, I get 2008 in the union SQL query and 2007 in the other query.

The regular query was generated from the union SQL query.

I believe that Microsoft access has an error in using a union SQL query.

Has anyone else had this problem, or know how to resolve this problem?

Thanks for your help.

Don
 
I still need to close a query using the close macro
No you don't. You shouldn't be running the query at all if it isn't for the user to view. It is NOT necessary to run a query prior to opening a report. Access runs the report's RecordSource query when you open the report or when you print it.

I believe that Microsoft access has an error in using a union SQL query.
None has been reported. The two queries are different in some way. That is why they are producing different results.

In the future, please start a new thread for a new question.
 
Print only selected on report, but final total of all records

I need to select only certain records to print on a report, but I need a final total of all records.


How do I do this?

Thanks
 
Create a query that selects the detail records you want to print and use that as the RecordSource for the main report. Create a subreport based on a totals query and place the subreport in the mainreport's Report Footer.
 
record time elapse

I need to display the time the report ran.

I have over 600,000 records.

I need to display the time it takes to run in minutes. The example below will not display the time correctly. How do I display the time in minutes?

Thanks,

example:

dim start1 as date
dim end1 as date
start1 = time()
end1 = time() -start1

msgbox(end1),, "Elapse time to run"
 
query using variable

I am using a query with a variable which select what records I want to use.

When I use the query from the query above it ask me for the variables again.

I do not want to input the variable again because I have the records I need but must use the 1st query for the secord query to build what I need.

How can I use the first query to build the 2nd query and not have to answer the variable input on the 2nd query? I already have the records needed.

Trust me, I need to build the 2nd query with the 1st query in order to do what I need to do. The first query select the dates I need, then the second query sums only the month and year and not the day of the month. However, I am asked for the dates again. I do not need for the user to put the dates in again. If you know how to do the operation all in one query, that would be great.

Thanks,

Don
 
Based on your description, you could use a single query. In any event, Access prompts each time it runs a query. Why do you have the same parameter in both queries. Surely only the first query needs the criteria.

Multiple prompts are more of a problem when running a report and the solution is generally to add a new form and to collect the prompt data in the form fields. You would then change the existing queries to refer to the form fields rather than to prompt for variables.

Where YourField = Forms!frmYourForm!YourField;
 

Users who are viewing this thread

Back
Top Bottom