473,320 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
Nov 13 '05 #1
2 1889
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& "' "

Nov 13 '05 #2
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
<dm******@hotmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
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& "' "

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DD | last post by:
I have a mainform with a subform. > The main form has a dropdown box "chooseMonth", in the afterupdate event > i requery the subform so all records with the same date are viewed. > Now i only want...
2
by: Craig M | last post by:
Hi, I have a form, frmInvoices and a subform, frmInvoicesSub. On the parent form, i have a "print report" button, that prints a report depending on an ID on the parent form. Each record in...
5
by: Nancy | last post by:
I have two tables: TblCourse CourseID CourseName TblClass ClassID CourseID ClassDate
1
by: epascual | last post by:
Have a couple of question from a newbie. Thanks in advance. How do I print Report called from a Form (or SubForm) using the current record on the Form (or SubForm). How can I do a multiple Form...
10
by: Thelma Lubkin | last post by:
My form/subform combination that allows user to display 'ColorSet' records, move to other records via a selector, to add,delete, and edit them, and to manage the related 'Color' records from the...
3
by: orbitus | last post by:
I know that I am overcomplicating this. I have records that need to be printed. Lets say 536 records, some on two or more pages in the report. I want to print 30 records, then 30 more till the...
4
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that...
3
by: paquer | last post by:
On my Main form I have a Command Button that opens a Subform in order to create a new Subform record. At this point I want the subform to show only the new record being created. Not all the...
1
by: dfw1417 | last post by:
I have used a query and report filter to return records related to a specific account id. I want to print a report including only the latest 6 records out of the set returned by the record filter. I...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.