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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report from button on subform

Status
Not open for further replies.

pflangan

Programmer
Jun 13, 2001
49
GB
I've got a customers form with an orders subform. The
subform is a continuous form, with a button next to
each record that should open a report based on the order next to it.

Now it works fine with the first customer, but when i move
records on the main form, the report comes up blank.

The subform updates itself fine, and i've gone into debug, and the report seems to be getting the right "where criteria"

docmd.openreport "orders", ,"orderID=" & me.orderid
or
docmd.openreport "orders", ,"orderID=" & forms![Customers]![Orders]![orderID]
 

What are your Parent & child properies set to?

If these are not properly linked you could get this type of issue.

Does the data in your subform change as you navigate the records?

Alternatively


docmd.openreport "orders", ,"orderID=" & forms![Customers].form![Orders]![orderID]

may have an effect

hope this is usefull
jo
 
thanks, I got it sorted. The problem was coming from the
recordsource of the report. I don't think i had the query built properly.

It's working anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top