Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Business Applications
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery registry cleaner router screen slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Image printing in Access 2000

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
TumTee Tum's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2009
Experience: Beginner
05-Nov-2009, 06:19 AM #1
Unhappy 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
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,341 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
05-Nov-2009, 07:28 AM #2
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
TumTee Tum's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2009
Experience: Beginner
05-Nov-2009, 07:55 AM #3
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
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,341 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
05-Nov-2009, 09:06 AM #4
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
TumTee Tum's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2009
Experience: Beginner
06-Nov-2009, 09:55 AM #5
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!
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,341 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
06-Nov-2009, 10:15 AM #6
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
TumTee Tum's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2009
Experience: Beginner
06-Nov-2009, 12:54 PM #7
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?
OBP's Avatar
OBP OBP is offline
Computer Specs
Distinguished Member with 9,341 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
06-Nov-2009, 01:01 PM #8
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
TumTee Tum's Avatar
Junior Member with 17 posts.
 
Join Date: Apr 2009
Experience: Beginner
06-Nov-2009, 02:35 PM #9
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
OBP's Avatar
OBP OBP is offline
Computer Specs
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.
TumTee Tum's Avatar
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.
OBP's Avatar
OBP OBP is offline
Computer Specs
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.
Reply Bookmark and Share

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.

Thread Tools


You Are Using:
Server ID
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.
Powered by Cermak Technologies, Inc.