UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Print Only Certain Items On Form, Access 2013    
 
   
gint32
post Oct 7 2018, 12:26 PM
Post#1



Posts: 266
Joined: 8-May 09
From: Australia


Hi everyone

I have a macro that simply prints the current form, but is there a way of enlarging it to A4 and only printing certain items or a range on the current form.

I have a calendar which is made up of text boxs and labels and this is all I wish to enlarge and print

if so can some suggest how to achieve this.

I am thinking if not, then should I set the items that I do not wish to be on the print to hidden beforehand, and then set them back after printing if this is the only way.,

thanks
This post has been edited by gint32: Oct 7 2018, 12:29 PM
Go to the top of the page
 
RJD
post Oct 7 2018, 12:32 PM
Post#2


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: Typically, you would design a report and have that print, rather than printing a form. Is there some reason this cannot be done in your case?

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
gint32
post Oct 7 2018, 12:36 PM
Post#3



Posts: 266
Joined: 8-May 09
From: Australia


thanks..no I have never done this though but will give it a try
Go to the top of the page
 
gint32
post Oct 7 2018, 12:38 PM
Post#4



Posts: 266
Joined: 8-May 09
From: Australia


can I also do this with

Print Range

The range to print. Click All (the user can print all of the object), Selection (the user can print the part of the object that's selected),
Go to the top of the page
 
RJD
post Oct 7 2018, 12:45 PM
Post#5


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: I don't think there is a Print Range available in Access (as it is in Excel). As I said, the usual procedure (and the easiest, actually) is to design a report, probably using the same query that feeds the form, and format it however you wish - size, content, layout. Then, when the user selects Print, the report, rather than the form, is printed.

Why not give that a try - and we can assist if you run into difficulty.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
GroverParkGeorge
post Oct 7 2018, 12:56 PM
Post#6


UA Admin
Posts: 33,778
Joined: 20-June 02
From: Newcastle, WA


Please permit an observation. While experience with Excel can be helpful, there are times when it is actually an impediment to successful implementation of an Access solution.

In this case, looking for a corollary to the "print range" functionality from Excel leads to an unworkable proposed solution.

Instead, one needs to adopt the appropriate tools at hand, or, as Joe has suggested, a REPORT, which can be designed exactly as you want.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 
gint32
post Oct 7 2018, 11:17 PM
Post#7



Posts: 266
Joined: 8-May 09
From: Australia


Hi
Don't think I can do this (report) as it seems to want a query as the main feed for the report, unfortunately the query only runs after a select from a combo, so it would be different each time . any other suggestions please
Go to the top of the page
 
gint32
post Oct 7 2018, 11:19 PM
Post#8



Posts: 266
Joined: 8-May 09
From: Australia


Hi
Can't use a report this way as my form uses a combo to filter each time, the form holds a calendar data for each user selected from the combo.
Thanks though.
Go to the top of the page
 
tina t
post Oct 8 2018, 12:10 AM
Post#9



Posts: 5,560
Joined: 11-November 10
From: SoCal, USA


QUOTE
Don't think I can do this (report) as it seems to want a query as the main feed for the report, unfortunately the query only runs after a select from a combo

doesn't sound like an obstacle to me - put the combo on a form, set the criteria in the query as a reference back to the form's combo, and set the query as the report's RecordSource. typically you'd put a command button on the form to open the report. so the user selects an entry from the combo's droplist, then clicks the button to open the report. the report's query runs, using the value in the form's combo, and populates the report.

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
RJD
post Oct 8 2018, 06:52 AM
Post#10


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: As tina says, that should not be an issue. Using a query as the record source for a report is usual and normal. And if the form is limited, and there is a control on the form that identifies that limit (criteria) (also a usual and normal approach), then you have all you need to create the query and display the appropriate data in the report. If the criteria are not available to the form, then, as tina suggests, you can use a combobox (or set of comboxes) to set the criteria/selections for the report.

The query need not be run before the report. Calling the report itself calls the source query, which uses the criteria to select its data, which is (or should be) available from the form.

If the field selections are different each time, based on user selection, then this is more difficult, but can still be accomplished. You just need to know what possible layouts might be selected.

If you are still having difficulty with this, perhaps you could post a db, with some example data and specifics for selecting data for the report, and someone here could take a look and advise you on this. This is helpful in our understanding of your situation and requirements.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
GroverParkGeorge
post Oct 8 2018, 08:37 AM
Post#11


UA Admin
Posts: 33,778
Joined: 20-June 02
From: Newcastle, WA


The only way this "could" be a problem would be if you return a different set of COLUMNS each time you run the filtered query.

Different ROWS, with different VALUES, should not be a problem at all.

Please elaborate a bit, or, as suggested, provide a sample db for review. We'd love to help you solve the problem the most efficient way, in Access.

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 
gint32
post Oct 8 2018, 08:42 PM
Post#12



Posts: 266
Joined: 8-May 09
From: Australia


I am not great with report(actually I am terrible). Does anyone got any simple examples for me to amend?
thanks
Go to the top of the page
 
gint32
post Oct 8 2018, 08:48 PM
Post#13



Posts: 266
Joined: 8-May 09
From: Australia


QUOTE
re-The only way this "could" be a problem would be if you return a different set of COLUMNS each time you run the filtered query.


its a calendar made up of text boxs, not sure what you mean with columns as its a calendar so it will be different each time a users data is loaded/displayed.
Attached File(s)
Attached File  calendar.jpg ( 106.64K )Number of downloads: 5
 
Go to the top of the page
 
RJD
post Oct 8 2018, 09:43 PM
Post#14


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: Seeing the empty calendar is not a whole lot of help, but seems to answer the question concerning variable report content. I assume you mean you want to print the calendar page (month) just as it shows on the form. But we don't know how you are loading the data in the calendar or laying out the calendar on the form. So, perhaps you could post the db (no sensitive data, compact and zip), and tell us how to fill in the form display you want to print. That will probably go a long way toward helping us help you.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
gint32
post Oct 8 2018, 10:53 PM
Post#15



Posts: 266
Joined: 8-May 09
From: Australia


I found the original mdb that has the calendar within, so this essentially has the same functionality. As I am working with now. so I just need to print the calendar(to an A4) with populated data of one of the students of course.. hope this example helps explain my issue better..
This post has been edited by gint32: Oct 8 2018, 11:31 PM
Attached File(s)
Attached File  calenderWITHOCX.zip ( 29.9K )Number of downloads: 4
 
Go to the top of the page
 
RJD
post Oct 9 2018, 01:35 AM
Post#16


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: I just pulled the controls and the code from the form over to the report, called the report identifying data controls by ref to the form (=Forms![Calendar of Attendance]!xxxxx), modified the code to ignore some lines that set values and got rid of the Repaint (see the RefDates code in OnLoad), and resized the calendar day controls to a larger size.

I did this with standard 8.5X11 paper format, but you can resize it to A4, and clean up the display layout.

See if this does what you are trying to do.

HTH
Joe

(Oh, and I left the spelling of calender (sic) as you sent it.)
Attached File(s)
Attached File  calender_Rev1.zip ( 39.57K )Number of downloads: 3
 

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
gint32
post Oct 11 2018, 09:19 AM
Post#17



Posts: 266
Joined: 8-May 09
From: Australia


Thanks for working on the uploaded DB, I've downloaded the amended Zip and looked at it and looks great so I can’t thank you enough, I have now imported the report and added the few lines of VBA to the event of the new button and compile, then the Form loads ok but when I click on the new button I get the following message.

Run Time error ‘2447’ There is a invalid use of the .(dot) or ! operator or invalid parentheses.

And then if I go to debug it stops at ..

CODE
Me![scrMonth] = Format(Me![scrCDate], "mmmm")


so I can’t figure out why as I know that particular line doesn’t have an issue as it steps through this when it loads the calendar but that's a great start for me...so thanks very much and thanks to everyone for your help.
Go to the top of the page
 
RJD
post Oct 11 2018, 10:40 AM
Post#18


UtterAccess VIP
Posts: 8,941
Joined: 25-October 10
From: Gulf South USA


Hi: Glad we are making progress. But I do not know where you have put the code that fails. Is this in the form code or the report code? Please show us all the code for the procedure that produces the error and where the procedure is located. We need to know what the Me! refers to.

HTH
Joe

--------------------
"Each problem that I solved became a rule, which served afterwards to solve other problems."
"You just keep pushing. You just keep pushing. I made every mistake that could be made. But I just kept pushing."

Rene Descartes 1596-1650 (Mathematician and Philosopher)
Go to the top of the page
 
GroverParkGeorge
post Oct 11 2018, 12:49 PM
Post#19


UA Admin
Posts: 33,778
Joined: 20-June 02
From: Newcastle, WA


WOuldn't that be Me. instead of Me!

--------------------
My Real Name Is George. Grover Park Consulting is where I do business.
How to Ask a Good Question
Beginning SQL Server
Visit My Blog on Facebook
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    19th October 2018 - 09:31 PM