Solved

Access 2003 selecting a bitmap field to display in a form

Posted on 2014-02-14
9
1,011 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

 
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 500 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Suggested Courses

635 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