Results 1 to 10 of 10
  1. #1
    Star Lounger
    Join Date
    Jan 2010
    Location
    Queensland Australia
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to embed a picture in a 2010 Access form without using VB scripting

    My wife who teaches Access and was used to teach using the Office 2003 suite, now has to teach her class with Office 2010.
    Her class is too low level to use VB, so she is asking how-to embed a picture in Access 2010 without using VB scripting. My wife has spent over 12 hours trying to find a suitable answer.

    Please reply, using a step type format so that even low level 14 year olds can understand.

    Bruno Terlingen

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Do you want just a single static picture on a form?
    or a picture that relates to a specific record, so that the picture changes as you move from one record to the next?
    Regards
    John



  3. #3
    Star Lounger
    Join Date
    Jan 2010
    Location
    Queensland Australia
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am attempting to get students to place one picture which relates to the specific record that they are viewing, so that the picture changes from record to record. It needs to be an embedded image (if this is possible). Kirsten (Bruno's wife)

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I just did a test of this, this way.
    • Created a new database in accdb format.
    • Created a table tblstudents with a field Photo of data type Attachment.
    • In the table, the photo field displays with a paper clip. Double click the paper clip tp choose a photo.
    • I then used the form wizard to make a form based on the table, and the photos were displayed.
    • In the form I could double click the displayed photo to change the photo, or to add a photo to a new record.

    That is all there was too it. Post back if something is not clear.
    Regards
    John



  5. #5
    Star Lounger
    Join Date
    Jan 2010
    Location
    Queensland Australia
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, I'll try this at work tomorrow - don't have the right version of Access at home. It is certainly a different way from any other that I've read or watched. I'll get back to you tomorrow night. Kirsten

  6. #6
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    In older versions of Access you typically just store the path and filename of the picture in the database, then use VBA code to display the picture.
    That does not work with continuous forms.
    The new method does work with continuous forms and is very simple, but storing the pictures in the database will make the database much bigger.
    Regards
    John



  7. #7
    Star Lounger
    Join Date
    Jan 2010
    Location
    Queensland Australia
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    G'day John. This is what my wife just emailed me:

    Do you mind pasting the following message on Windows forum to the person who replied? It is possible he was using Access 2007 and not Access 2010.
    • There is no data type called attachment in 2010.
    • Been to techies and done some reading. It seems as if this was removed between 2007 and 2010.
    • I only have OLE as the applicable datatype.
    • When I create a new database and add photos, it only displays the name of the photo file in the photo unbound frame. It does not display the actual picture.
    • If I double click on the photo name the photo displays, but not the form.
    • I have played with placing photos in the same folder as the database without success.
    • I have attempted to place the appropriate file name and path in properties without success.
    • I don’t know where I am missing the mark. I have viewed tutorials who claim it is possible, but so far I am out of luck.

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by Bruno Terlingen View Post

    • There is no data type called attachment in 2010.

    We are mixing up two different things here. Versions of Access and Access file formats.

    Access 2007 created a new file format - the accdb format- which introduced a whole lot of new stuff. Access 2010 introduced some further changes to this file format. The Attachment data type came with this new file format. It is very much current. It has not been removed. It has only just been introduced.

    But Access 2007 and 2010 are both still happy to work with the old mdb format. If you have a database in the old mdb format the Attachment data type is not available

    That is why my instructions said to create a new database in accdb format.

    attachmentDataType.gif

    If you have a particular need to work wth the old file format can you say so. With the old format I would just store the file name and path to the image file in a text field. But this requires code (or perhaps a macro could do it...I am very very rusty on macros) to display the images.
    Last edited by johnhutchison; 2012-03-02 at 02:11.
    Regards
    John



  9. The Following User Says Thank You to johnhutchison For This Useful Post:

    BigDaddyV (2012-03-08)

  10. #9
    Star Lounger
    Join Date
    Jan 2010
    Location
    Queensland Australia
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thankyou very much. I just tried it on a borrowed laptop with 2010. My error was in not saving as .accdb before I attempted to create the database. It now works and I can teach what I need to.

    I very much appreciate your patience.

    Kirsten

  11. #10
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Terrific. I am glad you got it to work.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •