Solved

Access 2003 selecting a bitmap field to display in a form

Posted on 2014-02-14
9
942 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
 
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WebBrowser Control - ms/ACCESS 9 31
How calculate median 5 38
formattig excel from access 3 17
Access on thin client? 11 35
This collection of functions covers all the normal rounding methods of just about any numeric value.
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now