View Full Version : Opening Form from Report


flect
07-07-2008, 11:54 PM
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

Private Sub StockNumber_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmstocktake", acNormal, , "ProductCode = Reports!Stocktake!StockNumber", acFormAdd, acWindowNormal
End Sub
Any ideas?

Darth Vodka
07-08-2008, 02:53 AM
Howdy

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


no it isn't :)

how about a sub form....

flect
07-08-2008, 03:03 AM
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.

Darth Vodka
07-08-2008, 04:44 AM
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?