Opening Form from Report

flect

Registered User.
Local time
Today, 16:12
Joined
Feb 26, 2008
Messages
86
Howdy

Just wondering if it's possible to open a form to a selected record from a report?

I have a stocktake/report system and what I would like to do is double click the [stocknumer] on the report and have it open on [frmStocktake].

i've been hoping that (reports!report!field) would work like (forms!form!field), but that doesn't seem to be the case

Code:
Private Sub StockNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmstocktake", acNormal, , "ProductCode = Reports!Stocktake!StockNumber", acFormAdd, acWindowNormal
End Sub
Any ideas?
 
do you mean it's possible to open a subform from a report but not a form, or do you mean I should create a subform with my report's layout ?

It's basically so that if i notice a discrepancy on the stocktake report, i can just double click the item on the report and open the appropriate form to edit the data.

i've got the double click opening the correct form, it would just be nice if i can jump straight to the record number i've clicked.
 
do you mean it's possible to open a subform from a report but not a form, or do you mean I should create a subform with my report's layout ?
the latter, create a subform instead of a report

i've got the double click opening the correct form, it would just be nice if i can jump straight to the record number i've clicked.

oh, ok, didn't even know that was possible, are you in Access 2007?

what is the value of Reports!Stocktake!StockNumber when the code runs?
 

Users who are viewing this thread

Back
Top Bottom