Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple, aligned queries in Report

Status
Not open for further replies.

comprt

MIS
Dec 17, 2002
5
US
Hi,

I am relatively new to advanced functionality within Access. I'm stuck with Access 97 as well. I am having some different issues presenting my data within a report. I wanted to know if anyone can help me with the following issues...I'd really appreciate it:

-----

1)How can I align my queries such that the results of each record print out in the following manner?

Query1

Record1 Record2 Record3 Record4
Record5 Record6 Record7 Record8

Query2

Record1 Record2 Record3 Record4
Record5 Record6 Record7 Record8

-----

2) How can I reference the records in a query by the order number? Suppose I want to display only record5 of query2? How would I do that?

-----

3) I am using different queries that reference the same table. I am being provided an error message when I try to use these multiple queries in the same report saying something like they are referencing the same data. Is there any way I can include multiple queries in the same report which reference the same information?

----
Thanks so much for your help.

Azal.
 
Hi,
When I need to do something like this, I utilize the DLookup function to return values from the tables. In a DLookup function, you can pass criteria to the function, and it will return the recordset. I generally use it to just return one value. Here is a sample where we want to geet the name of the state, using the two-letter state code. The table name is called "States", the key field is "fldStatesCode", and the long name for the state field is called "fldStatesName". The field on the report is called "StateCode".

Here's what the DLookup will look like as the Control Source for a text box field:
=DLookup("[fldStatesName]", "States", "[fldStatesCode] = '" & [StateCode] & "'")

(The StateCode needed to be encased by single quote marks because it is a string datatype.)
HTH,
Randy Smith
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top