Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image on form

Status
Not open for further replies.

Zorro1265

Technical User
Nov 14, 2000
181
US
I have an unbound image box on my form. Within the database is a table Images, inside is
ID
PEN (visit number to relate to other tables)
ImageName
Image (ole feild)

I want to populate these fields from a table called
tbllkupImageTmplt, within it are
ImageID
ImageName
Image (ole feild)

On my form I have a combo box that displays the names from tbllkupImageTmplt. I want to be able to pick a name and have it inserted into a frame named ImageOLEUnbound on the form. How do I make the frame show the image I select in the combobox and then save it into the Images table so I can put it on a report or view it on my form in the future.


Zorro
 
These FAQ's may help:

How to Load a picture in Access form
faq181-279

Print Linked Images in a Report
faq181-399

How do I allow users to easily link graphics to records.
faq181-432 Joe Miller
joe.miller@flotech.net
 
Thanks Joe,
I read these and they aren't quite what I need. The end users of my application may give me 5 minutes to show them how it works if I am lucky. If I try to have them look for images in a directory or count on them to load the right thing it will fail. Thats why I have to make them pick from my combo box with a simple name for the image. I'll keep pluggin away! Zorro
 
Ok can someone help me get the combo box to insert the image from the table into the form? I can't get the template from my tbllkupImageTmplt table to appear in the frame. Zorro
 
Okay I am using the following code on a button.

DoCmd.GoToControl "ImageOLEBound"
DoCmd.RunCommand acCmdInsertObject

This brings up a file request box to find the image. I have a combo box that has the path to the image I want to insert. The image is in a table in the database. I want to make it simple to pick the image and restrict what can be put in. How can I get this to work? Zorro
 
If anyone cares I found a way to do this. I have one ole feild that shows small thumbnails of the image I want to insert I use the old action.acolecopy to copy it to the clipboard and then action.acolepaste to put it in the second editable old feild. I remember someone was looking for a way to remove images from a database I think this may work for that too. Hope it helps someone. Zorro
 
Hi, Zorro!

If you saved pictures in the table (what I don't recommend) you can simply set form (or subform) recordset based on table what contains OLE field:
me.recordsource="Select ImageID, ImageName, Image From tbllkupImageTmplt;"
Create bound frame object with ControlSource = Image field.
Create unbound combobox with
me.cboFindImage.rowsource="Select ImageID, ImageName From tbllkupImageTmplt;"

Then write codes in the combobox AfterUpdate procedure:

private sub cboFindImage_AferUpdate()
dim rst as recordset

set rst=me.recordsetclone
rst.findfirst "ImageID=" & me.cboFindImage
if not rst.nomatch then
me.bookmark=rst.bookmark
endif
rst.close
set rst=nothing
end sub


Aivars

 
I used this on a command button to cpoy from one ole to another.

Me!frmImageTmplt.Form!ImageTmplt.Action = acOLECopy
Me.OLEBound34.Action = acOLEPaste Zorro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top