Solved Printing Help (1 Viewer)

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
Hi... being extremely new to Access, i am sitting here frustrated as anything trying to make this work. I will attempt to explain what I am trying to do.

I have a Main form that has subform. This Subform references a qry and pulls in all the checks info from the table but in the Main form I selected property sheets and linked a master field and a child field to display all the past checks of that selected client (as Shown in Image 1). What I am trying to do is add a print button on the form, so that the users can print off all the past check information on of just that client. Now I can use the normal print report feature and this prints of the entire report of all the checks of everyone, but what i would really like is the print button just to print that certain client check information and not all them just like it displays it on the Main form.
Ive had a look in the event field for the print button, but I have no idea of the commands to make it print like it shows in image 1. It prints like Image 2


I truly am lost, and seeking guidance from the masters here at Access World.

My printing problem is in your hands! Cheers!
from Chad!
 

Attachments

  • image 1.png
    image 1.png
    202.3 KB · Views: 100
  • Image 2.png
    Image 2.png
    239.9 KB · Views: 104

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
Hi Chad. Welcome to AWF!

Are you using a button to print your report? If so, you could try something along this line:
Code:
DoCmd.OpenReport "ReportName", acViewPreview, , "ID=" & Nz(Me.ID,0)
The above code passes a filter to the report where the ID field matches the current ID on the form. So, make sure you use the correct name for your ID field when you try it. Cheers!
 

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
Hi Chad. Welcome to AWF!

Are you using a button to print your report? If so, you could try something along this line:
Code:
DoCmd.OpenReport "ReportName", acViewPreview, , "ID=" & Nz(Me.ID,0)
The above code passes a filter to the report where the ID field matches the current ID on the form. So, make sure you use the correct name for your ID field when you try it. Cheers!
Thank you!
but I'm not quite understanding I tried it doing it but it asks for perimeters ID=
sorry if its a some what dumb question
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
Thank you!
but I'm not quite understanding I tried it doing it but it asks for perimeters ID=
sorry if its a some what dumb question
It will ask for a parameter "ID" if you don't have a field named ID. You will need to use the actual name of your field.
 

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
It will ask for a parameter "ID" if you don't have a field named ID. You will need to use the actual name of your field.
In the clients table I have an ID field but I dont really wanna have the User memorize the clients ID's any other way i can do it ?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
Ohh I get now. Thank you! I would just need to add the Id field to the report qry? becouse it seems to still to "print" all the data
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
Ohh I get now. Thank you! I would just need to add the Id field to the report qry? becouse it seems to still to "print" all the data
Yes, give it a try and come back if it still doesn't work. Cheers!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
Yes it not out to public so everything is a sample where can I upload it?
Do a C&R and then zip up your db and then click on the Attach files button when you post a reply.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
That Still still somewhat the same as the previous code just if and elses
Hi. Yes, it's the same because that's what we're saying you will need to do/use. To demonstrate what we mean, I created a small demo file for you. Open the attached file and run the report first. You will see there are more than one record displayed when the report opens. Now, open the form and click on the button to open the same report again. You should see that it only prints one record when you click on the button. Hope that helps...
 

Attachments

  • PrintDemo.zip
    35.8 KB · Views: 91

AccessBlaster

Registered User.
Local time
Today, 08:19
Joined
May 22, 2010
Messages
5,973
Chad, I feel like your table design needs more work before moving on to printing. I am not an expert by any means but, I do not think you need zip code as a stand alone table. Countries might not need its own table, contacts might be another word for customers. Compare your table to a normalized structure.

Northwind

HTH good luck with your project.
 

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
Chad, I feel like your table design needs more work before moving on to printing. I am not an expert by any means but, I do not think you need zip code as a stand alone table. Countries might not need its own table, contacts might be another word for customers. Compare your table to a normalized structure.

Northwind

HTH good luck with your project.
Kinda wanted to have it on its own table becouse i have combo boxes that call to that zip when adding companies. same wiht countries when verifying what ID they have showed us. so those combo boxed call to the different tables so you dont have to type it all out. and yes Contacts is name for clients. if you have any way to help improve it im all ears! thanks again for the help!
 

OfficialChad

New member
Local time
Today, 11:19
Joined
Feb 13, 2020
Messages
23
Hi. Yes, it's the same because that's what we're saying you will need to do/use. To demonstrate what we mean, I created a small demo file for you. Open the attached file and run the report first. You will see there are more than one record displayed when the report opens. Now, open the form and click on the button to open the same report again. You should see that it only prints one record when you click on the button. Hope that helps...
OH I see! ok ok. I think i found why it's doing this maybe.
the ID was different from ID in the report I just changed it to look at the client ID and make sure it matches to the ID on form and it worked! thank you guys so much! you guys are the Best!!!
 

Attachments

  • Annotation 2020-02-14 103756.png
    Annotation 2020-02-14 103756.png
    102.6 KB · Views: 87

theDBguy

I’m here to help
Staff member
Local time
Today, 08:19
Joined
Oct 29, 2018
Messages
21,485
OH I see! ok ok. I think i found why it's doing this maybe.
the ID was different from ID in the report I just changed it to look at the client ID and make sure it matches to the ID on form and it worked! thank you guys so much! you guys are the Best!!!
Hi. Glad to hear you got it to work. Good luck with your project.
 

Users who are viewing this thread

Top Bottom