 | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner | | Solved: Image printing in Access 2000 Hi
I want to put a print command button in an Access 2000 form to print an image (Image0 in the form) from the form. I want to have control of printer settings before printing. (To set portrait/landscape etc.)
At present I have only managed to get the whole form printed on many pages. Any suggestions please.
Alan | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Alan, let me make sure I understand your requirements.
You want the Current Record on the Form to be printed and it has an Image on it?
Are there other fields on the Form?
Is the image Stored in the Table as an OLE Object (which is a very poor use of Disc & Memry) or only referred to by it's Path (much more efficient)?
__________________ OBP
I do not give up easily | | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner | | Hi OBP
The form has an image0 frame. Image files are stored on disk and the path to the disk and directory are obtained from the underlying query.The image appears in the form image frame. There are other fields in the form which I do not want to print - only the image.
Alan | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Create a Select Query with the RecordID and the OLE Path fields.
In the criteria row of the RecordID enter
Forms![Formname]![RecordID]
where Formname is the name of your form and RecordId is your key field.
Select a Record on your form and then run the query, it should be the same single record.
Now create a report based on the new Query, to display the Ole Object on the report you will need the Ole frame as on the report with some VBA to display the Image.
When you get the Report working with just the one record come back and tell me the exact name of the OLE path field and the OLE frame and I will provide the VBA code.
__________________ OBP
I do not give up easily | | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner | | I have tried to do this with no success, I haven't attempted this before and so results are non existant.
The file path is generated by the form using data from a query. It will always be of the form ":\Photo Image\(Filename).jpg" Filename is from query.
The drive Ident will be 1 of 4 possibles provided by the data entry form and will be determined by an On Current event in the display form. This is then appended to the existing path to complete the path.
At present this path is used to load an .jpg file into the Image frame in the form.
As I have been unsuccessful in the previous task will this info. be of any help?
If not I can take the long route and load the image to my picture proccessing package and print from there. I know I can do this! | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | You use the same VBA that loads the Image to the Form's Image Frame in the Report Detail's "On Format" Event. the only thing that you need to do is filter the Report to only print the one record.
I can do it with a query or with the Command Buttn's VBA that opens the Report.
Can you tell me the Report's name, the Key field Name on the Form?
__________________ OBP
I do not give up easily | | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner | | I have got a report working - ish.
The image is appearing on page 1. but foreshortened
Page 2 is blank
Page 3 is the foreshortened part of image
Page 4 is blank.
I have made section detail to A4 size and image size the same to match. Margins are set to 1.5cm which suits the printer.
The report name is "rep1Photo" and event is listed below:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
DoCmd.Maximize
Address = [Forms]![frm3Photo]![File]
Me![Landscape].Visible = True
Me!Landscape.Picture = Address
End Sub
I would like a command button to allow access to printer setup prior to printing. Is possible? | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer | | Set the Image Field's "Size Mode" to Zoom.
On the Command Button that opens the Report add
,acPreview
on the end of the Docmd.open line of code. When you type the Comma it gives you a dropdown to choose it from.
i.e.
docmd.openreport "rep1Photo", acpreview | | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner | | That works! Thanks very much. Can I make the image print at normal size. At present it fills the whole A4 page. Mode size set to zoom | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer |
07-Nov-2009, 05:41 AM
#10 | You should be able to just size the Image field to what size you want. | | Junior Member with 17 posts. | | Join Date: Apr 2009 Experience: Beginner |
07-Nov-2009, 06:18 AM
#11 | Thanks very much for your help, I have never used Reports before but can see other areas where they could be useful. | | Distinguished Member with 9,341 posts. | | Join Date: Mar 2005 Location: UK Experience: An old Basic Programmer |
07-Nov-2009, 06:50 AM
#12 | They can be extremely powerful when combined with good Queries. | |
Smart Search
| Find your solution! | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |  WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
| You Are Using: |
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 08:43 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd. | |
|