Connecting Tech Pros Worldwide Help | Site Map

Limit Records Printed with Print Button on Subform.

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 08:28 AM
ChadDiesel
Guest
 
Posts: n/a
Default Limit Records Printed with Print Button on Subform.

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



  #2  
Old November 13th, 2005, 08:28 AM
dmkeith2@hotmail.com
Guest
 
Posts: n/a
Default Re: Limit Records Printed with Print Button on Subform.

I get help here also.

Put the following in your On Click event procedure on the command
button.

Me.Refresh
DoCmd.OpenReport "YourReportNameHere", acViewPreview, ,
"[RelatedField]='" & Me.RelatedFieldAgain& "' "

  #3  
Old November 13th, 2005, 08:30 AM
ChadDiesel
Guest
 
Posts: n/a
Default Re: Limit Records Printed with Print Button on Subform.

Hello,

Thanks for responding. I am a little confused about what you said, because
I'm very new to access. My form and subform are set up in the following way:

The main form is a table called Ship_Info, and the subform is a table called
Label_Info. They both contain and are linked by a field called Load_ID. My
report is actually a shipping label called "Label". I know where to put in
this code, but I wasn't sure how it was set up. It was also hard to tell
apostrpohes from quotation marks. Here is what I tried:

Me Refresh
DoCmd.OpenReport "Label", acViewPreview,,"[Load_ID]='"(note: apostrophe,
quote) & Me.Load_ID & '" " (note: apostrophe, quote, space, quote)


so without the notes:

Me Refresh
DoCmd.OpenReport "Label", acViewPreview,,"[Load_ID]='" & Me.Load_ID & '" "

I know the second part is not right-maybe none of it. I don't think I have
the Load_ID in the right place.

I want the button on the subform and to print only the records on the
subform. For example, N1 is the load ID for load #1 going to Nashville.
I'll change the Load_ID to something more meaningfull when I get this form
going.

I would appreciate any help you could give me.

Thanks,

Chad
<dmkeith2@hotmail.com> wrote in message
news:1111881305.453433.201070@l41g2000cwc.googlegr oups.com...[color=blue]
>I get help here also.
>
> Put the following in your On Click event procedure on the command
> button.
>
> Me.Refresh
> DoCmd.OpenReport "YourReportNameHere", acViewPreview, ,
> "[RelatedField]='" & Me.RelatedFieldAgain& "' "
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.