Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2003 selecting a bitmap field to display in a form

Posted on 2014-02-14
9
Medium Priority
?
1,057 Views
Last Modified: 2014-02-20
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
Comment
Question by:phoenix55
  • 3
  • 3
  • 2
  • +1
9 Comments
 

Author Comment

by:phoenix55
ID: 39858582
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
 
LVL 39

Expert Comment

by:thenelson
ID: 39860521
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
 
LVL 40
ID: 39860557
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 26

Expert Comment

by:Nick67
ID: 39860801
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
 

Author Comment

by:phoenix55
ID: 39865720
Thank you Experts, apologies for delay, ultra busy weekend. Zip file attached.
AuditZip.zip
0
 
LVL 26

Expert Comment

by:Nick67
ID: 39868764
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
 
LVL 39

Expert Comment

by:thenelson
ID: 39868873
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
 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 total points
ID: 39868995
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
 

Author Closing Comment

by:phoenix55
ID: 39874884
Thank you Experts, excellent effort & works very well.
0

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question