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

report curent record on the form

Status
Not open for further replies.

damir

IS-IT--Management
Feb 6, 2002
18
HR
My form present some data, and i need to make simple report of it. All is fine on the first look, but generated report content all records from table(s) presented on the form. I need report with only curent record.
???
Thanks
Damir
P.S.
I need query to catch "ID" from active record presented on the form. (ID is Autonumber field in this table) After this i can make somthing like
SELECT * FROM AllData where ID in (select ID from "where ID is ID of curent active record on the form)
After this i can make report based on this query and conect it to some button on tihs form?
 
It is possible to open a report with a Where:
[tt]DoCmd.OpenReport "rptReport", acViewPreview, , "ID=" & Me.ID[/tt]

The above assumes that ID is a numeric field and the code to open the report is run from the form that has the ID to be used in the report (Me means current form).

It is also possible to refer to a field on a form in a query. For example, you can put:
Forms!frmForm.txtTextBox
On the criteria line of a query.
 
Nice...i like last one very much!!!
Thanks so much
Damir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top