View Full Version : Link Report to Record in Form


PNGBill
07-15-2008, 12:27 PM
Hi, I have a Form showing data for a Club Member with buttons that activate reports for the Club Member. One report is a statement via a macro. The first query is a Make Table query selecting Member ID. I would like to link the Forms Member ID to the Query Member ID. For the other Reports I have done this by adding "[LDPK]="&Me![LDPK] to the DoCmd in the on click event but this does not work for the macro report. Appreciate any ideas.:confused:

statsman
07-16-2008, 10:28 AM
In your query set the criteria to the form field you want a report for.
If the form is called frmMemberSearch and the field is MemberID you would set the criteria to:

[Forms]![frmMemberSearch]![MemberID]

PNGBill
07-16-2008, 02:06 PM
Thanks Statsman. Link works fine. Appreciate your assistance.
Regards, Bill

PNGBill
07-16-2008, 05:39 PM
Hi Statsman, New problem on Link issue.. The form also has a subform with records of Loans. I have a number of buttons for the records that call up forms and reports for the given Loan but when I dded a button to activate a statement for a loan it does not recognise [Forms]![QFindClubMembLoanQuerysubform]![LDPK] and still asks for a manual entry. Is there some diff between a form and its buttons and a subform and its buttons??
Appreciate advise, Regards, Bill

statsman
07-17-2008, 11:57 AM
It sounds as though your query is requesting a different parameter. Double check the query that's run from the command button to create the statement.

PNGBill
07-17-2008, 01:37 PM
The subform is continous with often more then 1 LID (link field). Could this be the problem with linking to [formname]![fieldname]. The button is on the record itself. I am thinking of inserting a form at the beginning of the macro that selects the LID record and then the macro uses that form which only has one record. Will try in an hour or so. Regards,
Bill