![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Everyone on this group has been a great deal of help. I have another question that I could use some help with. Once again, here is a picture of my form: http://www.chadworld.com/images/form.jpg I have a form with a shipment destination at the top. I then have a subform that I enter boxes for that shipment. I have several shipments going at a time, so I can use the control at the bottom of the form to move from shipment to shipment and I can see all the boxes in each shipment. The form and subform are linked by a field called Load_ID. I would like to put a button called "Print Labels" on the subform so it outputs the boxes from that shipment to a report which I have set up to print labels. I set this button up, but it prints all the records in the database instead of just that subform. I will be constantly adding shipments with new Load_IDs, so I want a button that I can always press on the subform to print the labels. What I am trying to say is that I don't want to have to run a query for a specific Load_ID like "SD1". I want it to be expandable and always print the subform I am on, no matter how many subforms I have. Is this possible? If so, any suggestions would be appreciated. Thank You, Chad |
#3
| |||
| |||
|
|
Hi Chad. You have to get sneaky to do this. Reports are based on queries or tables. You can't directly base a report on a form or subform. Your subform is based on a table or a query which you have filtered using the boxes in the header. From your question it would seem that the filter is Load_ID. Create a query:qryLBLPrint Base it on the table the subform is based on. In the criteria for Load_ID put: Forms!MainFormName!Load_ID Substitute your actual form name for "MainFormName" and the name of the text box that has Load_ID. This query, run while your form is open should give you the same records that you see in the subform. Then base the report on the query and you can run the report from a command button on the main form. Good Luck Ira Solomon On Sat, 26 Mar 2005 22:19:32 GMT, "ChadDiesel" shaqattack1992-newsgroups (AT) yahoo (DOT) com> wrote: Everyone on this group has been a great deal of help. I have another question that I could use some help with. Once again, here is a picture of my form: http://www.chadworld.com/images/form.jpg I have a form with a shipment destination at the top. I then have a subform that I enter boxes for that shipment. I have several shipments going at a time, so I can use the control at the bottom of the form to move from shipment to shipment and I can see all the boxes in each shipment. The form and subform are linked by a field called Load_ID. I would like to put a button called "Print Labels" on the subform so it outputs the boxes from that shipment to a report which I have set up to print labels. I set this button up, but it prints all the records in the database instead of just that subform. I will be constantly adding shipments with new Load_IDs, so I want a button that I can always press on the subform to print the labels. What I am trying to say is that I don't want to have to run a query for a specific Load_ID like "SD1". I want it to be expandable and always print the subform I am on, no matter how many subforms I have. Is this possible? If so, any suggestions would be appreciated. Thank You, Chad |
![]() |
| Thread Tools | |
| Display Modes | |
| |