View Full Version : no data to report error


BuccosRuleAll
07-06-2005, 08:40 AM
i've created a form for purchase orders and a report for the purchase order...when i go to preview the report it shows up blank, even though my control sources are linked to the original purchase order form. i cannot for the life of me figure this problem out...please help! let me know if you need other information, but hopefully someone has figured a similar problem out before...

WayneRyan
07-06-2005, 04:21 PM
Buccos,

Do you really mean that your Report controls are linked to your Form controls?

You should base your report on a query.

Then on your form, put a Command Button. In its OnClick [Event Function], put:

DoCmd.OpenReport "YourReport",,,"[YourKeyField] = " & Me.YourKeyField

If your key field is a string:

DoCmd.OpenReport "YourReport",,,"[YourKeyField] = '" & Me.YourKeyField & "'"

Then your report will display only the info that's displayed on your form.
The Report's ControlSources should point to your query.

Wayne