• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1077
  • Last Modified:

Access 2003 selecting a bitmap field to display in a form

Hi Experts,

I have an Access 2003 database with 2 tables linked into a single continuous form, what I am attempting to do on the form is allow the end user to select his ID from a combo box field that will paste (or embed) and display the users (bitmap *.bmp) ID_Stamp to a field in both the respective storage table and on to the form based upon the selection in the combo box by the user.

Table 1 = tbl_Auditors
Field 1 = Auditor_ID
Field 2 = Auditor_Stamp (Bitmap picture = Ole_Object)

Table 2 = tbl_Audit_Information
Field 1 = Auditor_ID
Field 2 = Auditor_Stamp

Form 1 = frm_Audit_Information
Field 1 = Auditor_ID (Combo box = Selects ID)
Field 2 = Auditor_Stamp (Bound Object Frame)

The Stamp field is not displaying itself on the form unless I physically copy and paste it into the table.  Do any of you Experts have VBA code or a method that will work with this situation please?  Much appreciated if you do.
0
phoenix55
Asked:
phoenix55
  • 3
  • 3
  • 2
  • +1
1 Solution
 
phoenix55Author Commented:
Note: I have attempted to execute an Update Query within the IDE by DoCmd on both Timer and subsequently Mouse_Move but for some reason this still does not update the Object field with the bitmap in either the Form or Audit information table, it remains blank unless pasted within the table itself.
0
 
thenelsonCommented:
In Access 2003 and before, it is preferable to store an image outside of Access (unless it is a very small image file) and link to it as Access does not store images efficiently.

This sample database will show you how to imbed images in Access: http://thenelson.name/#ImbededImageDemo

This one will show you how to link them to an outside file: http://thenelson.name/#LinkedImagesDemo
0
 
Jacques Bourgeois (James Burger)PresidentCommented:
I completely concur with thenelson. Not only is storing images in the database inefficient.

And unless you have very few or very small images, you will eventually end up hitting the maximum file size of your Access database file, which is 2 Gb.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Nick67Commented:
I concur with both of the previous posters that you don't want to store the files, but you'd want to store the files, and then link to them.  That leaves you two parts to work on.  How to allow someone to select a file to use as their ID_Stamp, and how to display it after the select their name from a combo box.  Post a sample zipfile that contains an almost data-free version of your working forms and tables, and some small images to use as the Stamp_ID's and we'll demo how to flange it up.

The displaying is fairly simple.  An Image control contains a .Picture property that can be any valid path.  The selecting and capturing is more involved.  You'd use the FileDialog object in VBA to permit them to select, FileSystemObject to place the selected image some place and then a Recordset object to create the records in the table to point to the saved object.
0
 
phoenix55Author Commented:
Thank you Experts, apologies for delay, ultra busy weekend. Zip file attached.
AuditZip.zip
0
 
Nick67Commented:
Upon further review, you cannot do a linked image on a continuous form in Access 2003.
Later versions of Access include methods to use an unbound image frame's .Picture property to manipulate the image on a continuous form ( or more precisely an image can be bound to a text field that is a valid file system path).

You can do it on a single form
You can do it in a report.
But you can't do it on a continuous form in Access 2003.

Is your sample very rough, or are you just beginning in Access?
Because your tables are not normalized.

A discussion of how to do it in A2007+ is here
http://social.msdn.microsoft.com/Forums/office/en-US/00004ce2-a5c2-4f3e-a7be-2782b27c8fa0/images-on-continuous-forms?forum=accessdev

And thenelson's sample shows how to do it on a single (not continuous) form
0
 
thenelsonCommented:
Nick,

Actually imbeded images can be used in a continuous form in Access 2003. My sample database http://thenelson.name/#ImbededImageDemo has a form that does that. Of course, imbeding large images without bloat would require coding to store BLOBs which I would guess is beyond the capabilities of the asker.

It might be possible to load linked images into a continuous form by calling a function in the conditional formatting utility but it would be very slow.
0
 
Nick67Commented:
In A2003, which is the Asker's platform, to get an image to change for each record on a continuous form requires a bound control.  An unbound control on a continuous form takes a single value across all records.  I've got an article about how to work around that in certain situations.

http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_6692-Overcoming-unbound-continuous-forms-limitations-by-staging-data.html

But given that the image control cannot be bound to a text field with a path until A2007 or later, and given that you cannot put a subform on a continuous form, you are stuck with putting the bitmaps in the database.

Now, maybe I misunderstood the design, and things are properly normalized.  To me, it seemed they weren't.  Does each auditor have only a single stamp?  If so, then only 4 images need to go into the table, and that is Auditor's table.

Here is the sample, normalized the way I think it needs to be.  Key names have been changed, and the Primary Key / Foreign Key of the relationships changed how I think they need to be done, and the comboboxes have been fiddled with.

But, it shows the image associated with each initial on each line of the form out of an OLE object field.
Audit-db1.mdb
0
 
phoenix55Author Commented:
Thank you Experts, excellent effort & works very well.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now