Report prints too many records!

chuckgoss

Registered User.
Local time
Today, 18:11
Joined
Mar 26, 2001
Messages
44
Hi all,

Please, help me through this...I've looked at various similar posts here in the Reports forum, I know what I'm supposed to do, but I'm still unable to get this to work.

I have the folowing code in my form:
DoCmd.OpenReport "Return Form for ChuckG Rpt", acViewNormal

I know that I need a filter at the end of that statement so that I limit the report to only that information that is on my form.

I have looked at the Open Report Method, and Open Report Action...learned a lot, but still fall short. The form is based on a table, and there are 2 combo boxes that use different queries from each other on the form. The form simultaneoulsy displays data from 2 different records contained in the table. I wish to print the filled out form, and do so by means of the report that was created by saving the form as a report. The table uses a unique index number for each record.

What should the filter code at the end of the statement be?

Thanks in advance,

chuck
 
Hi there,
You can do this by:
1. Using a saved Filter
2. Using the "where" Clause without the word where.(Note the commas separating the Arguments)I like this way better.

DoCmd.OpenReport "Return Form for ChuckG Rpt", acViewNormal,,"[UniqueID]=" & me.UniqueID

If the UniqueID is a string you may need to inclose it in single quotes like this:

DoCmd.OpenReport "Return Form for ChuckG Rpt", acViewNormal,,"[UniqueID]=" & "'" & me.UniqueID & "'"


[This message has been edited by MarionD (edited 05-08-2001).]
 
MarionD,

Thanks! It works great!

If you have the time, a quick question for my own education.

The filter; "[UniqueID]="& Me.UniqueID
I assume that "[UniqueID]=" refers to a control on the report that I print. What is the function of the = in that piece? Also, what is the function of the & symbol in the filter?

Thanks again for your help

chuck
 

Users who are viewing this thread

Back
Top Bottom