Putting A Value from a Query on a Form - New to Access

randommetalguy

Registered User.
Local time
Today, 04:05
Joined
Nov 25, 2008
Messages
52
Hey Guys,

I've been putting a post in each section of this forum the past few days as I learn Access. But, you guys have been helpful since I am ready to generate reports based on my queries. Here's how my application is laid out:

Form1 - get 3 user input values, calculate a value, and do queries based on the 4 values
Query 1, 2, & 3 - extract a single record from my tables based on input from Form 1
Report1 - Display the results from the 3 queries.

The user presses a button on Form1 the queries run and the report is shown.

Now, I can take the values that are on Form1 and display them on the Report just fine, but I'm having problems getting values from my queries.

Right now I have two text boxes on my Report:

Text box 1's Control Source looks like this: =[Forms]![Form1]![txtBox1].[Value] this one works
Text box 2's Record Source looks like this: =[Queries]![Query1]![Field1].[Value] this one does not work and I get a ?Name# error when the report is shown during execution. Also, only one record gets returned from my queries no matter what the input values are in case this helps you solve my problem.

I hope this is an easy fix and I've tried using the Report Wizard but I get an error "You have chosen fields from record sources from which the wizard cannot connect."

If I can get this figured out, I'll have my prototype solved and I'll just have to duplicate the process to complete the rest of my application.
 
The query should be first loaded into a control on a form before u can connect to its fields. So u can either create a form, with the query underlying it, then connect to a control on that form that retrieves the field in question, or u may put "Dlookup("Field1";"Query1") in text box 2.

HTH
 
You can't reference a query value that way. Try

=DLookup("Field1", "Query1")
 

Users who are viewing this thread

Back
Top Bottom