Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11

    How to center a bitmap image in a bound object frame?

    Any help with this would be much appreciated. I managed to get each record in a continuous form in Access 2003 to display a different bitmap image, but the bitmap images that are not the size of the bound object frame, display in the upper left corner, rather than in the center. I am wanting them to display in the center of the bound object frame.
    I've done many searches and looked at many pages over several days and still not found a solution, so I am posting this question.
    Can anyone help with this?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Do you have a table with OLE objects in it? If there is a way of getting the dimensions of the various files, maybe you could adjust the padding on the OLE control. Maybe you could get the dimensions prior to importing the file.

    I suspect the easiest would be to use an image control and link to images in a folder on a server.

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I am on Access 2010 so I am not sure about earlier versions - I see a property called Size Mode which I set to Stretch and it centered the image.

  4. #4
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Thanks for your reply. Regarding using an image control: Unfortunately I was not able to make that work for me, and after much searching and reading in various forums I switched to using a bound object frame, which gave me a different image on each record in the continuous form.

    What you said regarding dimensions and padding is interesting. To test that I will see if I can adjust the padding on the OLE control in the case of one image that doesn't fit the shape of the frame. Thank you for that idea.

  5. #5
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Thanks for your reply. Regarding using an image control: Unfortunately I was not able to make that work for me, and after much searching and reading in various forums I switched to using a bound object frame, which gave me a different image on each record in the continuous form.

    What you said regarding dimensions and padding is interesting. To test that I will see if I can adjust the padding on the OLE control in the case of one image that doesn't fit the shape of the frame. Thank you for that idea.

    Using the stretch functionality is not an option. That is, the customer has made it clear that the images are not to be stretched, but thanks for that.

    If you've used an image control on a continuous Access 2003 form and had success linking it to a folder of images, with the result that you have different images on each record in the continuous form, please would you outline what you did.

  6. #6
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Sorry, I hadn't meant to repeat myself. Thank you both for your replies. Looking forward to hearing more, from you and maybe from others too!

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    in 2010 the image control has a picture alignment property - one of which is centre.

    If it is not available in 2003 and it is something your client insists on, suggest he spends a few pounds and upgrades.

  8. #8
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Thanks, I agree! Have spent a lot of time testing possible solutions that use image control. But no joy yet!

  9. #9
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I don't have 2003 in front of me here. However, assigning different picture files to the picture property is how you get it done in 2003. The easiest is to use the Wizard to add the picture control and then delete the embedded picture by erasing the text in the Picture property. You will get a prompt to verify removing the picture. Then, in VBA using the On Current Event of the form, assign the path and file name to the Picture Property.
    Code:
    Me.ControlName.Picture = "The_UNC_Path_To_The_File"
    So you can store the corresponding path in the same Row/Record that you would otherwise have the OLE.

  10. #10
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Thanks. That's basically what I did in the case of a single form, i.e. where one record is viewed at a time, the On Current event fires and the picture changes. However, that didn't work for me where I have a continuous form.

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Corsica51 View Post
    ... However, that didn't work for me where I have a continuous form.
    Correct. I was ignoring that point. There is a workaround. I am not remembering it perfectly. I think it has to do with an OLE field in a table. Is it feasible for you to write to a temp table?

  12. #12
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,398
    in your table, store the unc path in a text field

    on your form bind the image control to the unc field

    Not sure this is available in 2003

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Ajax View Post
    in your table, store the unc path in a text field
    ...
    Yeah, I forgot about the new thing, again.

  14. #14
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    I believe that's the work around that I implemented. Unfortunately, the images that aren't the same shape as the bound object frame appear to the upper left, rather than in the center.

  15. #15
    Corsica51 is offline Novice
    Windows 10 Access 2003
    Join Date
    Sep 2016
    Posts
    11
    Ajax,

    Yup, did that. Worked a treat in a single form, but for continuous forms I used the work around mentioned in this thread, which is great provided the image fits the bound object frame.

    Thank you for your reply.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 10-21-2015, 10:37 PM
  2. Bound Object Frame
    By bigguy in forum Forms
    Replies: 4
    Last Post: 04-15-2015, 03:14 PM
  3. Replies: 1
    Last Post: 05-30-2012, 03:51 PM
  4. Bound Object Frame Combo sorted Results
    By kevsim in forum Programming
    Replies: 7
    Last Post: 01-08-2011, 06:30 PM
  5. Replies: 1
    Last Post: 08-05-2010, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums