1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Image printing in Access 2000

Discussion in 'Business Applications' started by TumTee Tum, Nov 5, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    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
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    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)?
     
  3. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    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
     
  4. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    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.
     
  5. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    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!
     
  6. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    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?
     
  7. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    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?
     
  8. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    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
     
  9. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    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
     
  10. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    You should be able to just size the Image field to what size you want.
     
  11. TumTee Tum

    TumTee Tum Thread Starter

    Joined:
    Apr 7, 2009
    Messages:
    18
    Thanks very much for your help, I have never used Reports before but can see other areas where they could be useful.
     
  12. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,840
    They can be extremely powerful when combined with good Queries.
     
  13. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/874629

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice