Open report from another report (1 Viewer)

FreonIceMan

Registered User.
Local time
Today, 14:25
Joined
May 31, 2011
Messages
19
I have a database I am working on. When I am on my one form it has a report that shows a summary of different orders for a single customer. When I click on one of the summaries I want it to open the full detailed report based on which line in the report was clicked. How would I go about getting this to work?

Below is the code I attempted to use. I keeps prompting me for which record to open.

Code:
Private Sub Detail_Click()
[INDENT] TempVars.Add "tmIns_ID", txtPT_Ins_ID
[/INDENT][INDENT]     DoCmd.OpenReport "Order_Details", acViewReport, "", "[Reports]![Order_Details]![Order_ID]=[TempVars]![txtOrder_ID]", acNormal
[/INDENT] 
End Sub
 
Last edited:

contractor

Having Fun With Access
Local time
Today, 11:25
Joined
Apr 12, 2012
Messages
47
Try this one:
Code:
DoCmd.OpenReport "Order_Details", acViewReport, , "Order_ID=" & Me.txtOrder_ID", acNormal
 

FreonIceMan

Registered User.
Local time
Today, 14:25
Joined
May 31, 2011
Messages
19
Hi contractor,

I tried your code as written and I was getting a compile error until i removed the quote at the end of Order_ID

So now it looks like this:
Code:
DoCmd.OpenReport "Order_Details", acViewReport, , "Order_ID= & Me.txtOrder_ID", acNormal

Now I am getting:
Run-time error '3075':
Syntax error (missing operator) in query expression 'Order_ID= & Me.txtOrder_ID'

I can't figure out why it's not working, any ideas?

Thanks,
-Freon
 

Users who are viewing this thread

Top Bottom