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

Access: Printing Forms with embedded subforms

Status
Not open for further replies.

nwn5

MIS
May 24, 2002
10
US
I've gone every where with this problem with no help so far and never have I come here to this awesome forum community and been disappointed with the results. So I'm back again with another nasty ole problem =)

Here she is:
I have a form with an embedded subform. For each record in the mainform, I could have several subform records available to choose. When I print, I am unable to print the mainform record along with a single subform record. When I go to the print function, I'll select "selected record(s)", and it will print the selected mainform record, but it also prints ALL the subform records. I only want it to print the selected mainform record and the single selected record in the embedded subform.

I was given advice that it is not good to print from a form but rather I should design a custom report that can filter just the records of the subform I want printed. Any views on how this is done when dealing with the embedded form?

Basically I was thinking of doing this by placing a Print button on my mainform page that would take and filter out all but the currently selected records that are being viewed on the Mainform and the merged Sub-form, then send them to the custom Report to print. But once again I have no idea how to do this.

To describe my expertise in Access would be to sum it up in the word "Nada". I'm a very very basic user so please in your answer be as detailed as you possibly can. I realize that there might be a huge detailed answer to this question so feel free to type as big of explaintion as you desire to. I apprieciate any information you can provide into this situtation even if its a website to go to or a differnt way to approach the problem.

Thanx again everyone for your help, and if you need to know any more detailed information about the problem or need something to be explained a bit more clearly please feel free to post that up and it will be answered as soon as possible =)

Thanx, and I hope everyone has a great Memorial Day Weekend =)
 
The easiest and probably the best way to handle your situation is to follow the advise to create a custom report with a query that will print the selected records from the Main form and SubForm.

First of all, how are you selecting the records in the subform? CheckBox, etc.

You will need to create a query that includes both the Main form table and the Sub form tables. I take it that this is a one-to-many relationship. I can help you to create this query but I will need a little more info about your tables and linking field names.

Once this query is built and it selects the correct records using the data objects on the Main Form and Sub Form the creation of the report is quite easy.

So, let's stop there and you supply some additional information about your data files.

Bob Scriver
 
A couple of months ago, I sent the previous inquiry and you responded with the text listed above. The time was bad for me, as I was just entering our busy time at work. Now I have picked the project up again. So far, I've followed the advice by doing the following:

1) I have made ONE query (Query A) using both queries that make up the Main form and the Subform.
2) I have created a custom report from Query A.

Additional Information:
1) The Main form and Subform are a one-to many relationship. The linking field is the legal description of land. For each piece of land (main form), there can be many work orders (subform).
2) I use combo boxes to select records in both the Main form and Subform.

The report looks good and seems the way I need to go re// printing. However, Query A does not make a selection based on what the user selects in the combo boxes on the forms (main and sub), hence, the report prints all the work orders instead of just the selected work order. Is there a way to get the query to filter the proper record in a user friendly manner?

Thanks very much for the help.
Best Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top