dbTalk Databases Forums  

Limit Records Printed with Print Button on Subform

comp.database.ms-access comp.database.ms-access


Discuss Limit Records Printed with Print Button on Subform in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ChadDiesel
 
Posts: n/a

Default Limit Records Printed with Print Button on Subform - 03-26-2005 , 04:19 PM






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




Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: Limit Records Printed with Print Button on Subform - 03-29-2005 , 03:00 PM






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:

Quote:
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




Reply With Quote
  #3  
Old   
ChadDiesel
 
Posts: n/a

Default Re: Limit Records Printed with Print Button on Subform - 03-29-2005 , 05:21 PM



Thanks for the advice Ira. I've received a lot of helpful information here.

Chad


"Ira Solomon" <isolomon (AT) solomonltd (DOT) com> wrote

Quote:
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






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.