Add an image embedding mechanism

  • Thread starter Thread starter Stephen Carpineta @ Matco Electric
  • Start date Start date
S

Stephen Carpineta @ Matco Electric

Good morning/afternoon/evening, and thanks in advance for
looking over my post!

I am setting up a database to hold information for all
the projects my company has open. It stores several text
values, as well as an embedded bitmap image object in one
field, to be displayed in the form as that particular
record is opened and displayed.

I have no problem getting the images into the records
through the table design-view, however, I want users to
be able to do this from the form, so that when they are
adding in a new project/record, they can add the image
also. Is there any funciton I can use to open
the "common dialog" control to allow users to browse for,
select, and add a bitmap image as a field in a record?
Is "common dialog" even the right approach" When I try
to use this control, which i was informed dealth with
the "open/save" window, it says I lack the appropriate
license. I appreciate all the help everyone continuously
gives me, Thanks again,

Steve Carpineta
 
Maybe you could use the FileDialog object to achieve this objective.

Dim fd as FileDialog, item as Variant
Set fd = Application.FileDIalog(msoFileDialogFilePicker)
With fd
.AllowMultiSelect = 0
If .Show = -1 Then
'at this point, the "item" variable contains the file path location
and file name in string format
'along with the index number of the ItemsSelected Collection. At
this point, you can use
'the file I/O to manipulate this task.
msgbox "File to be embedded: " & item, 48
End If
End With
Set fd = Nothing

One of the things, I presumed you have weighed the differences between
embedding an object versus linking an object. I generally prefer linking
over embedding for individual record basis.

Two other alternatives:

BOUND CONTROL METHOD

Setup a field as OLE Object field

Click the "Image" toolbox icon onto the form in design view

Click the Field List toolbar button

Drag the bound OLE Object field onto the form at the point where you want
the upper left corner of the bound image to show on the form

On the control, set the following Properties:

Enabled = Yes
Locked = False

UNBOUND CONTROL METHOD

Drag the "Unbound Object Frame" toolbox icon onto the form in design view

In the Insert Object dialog box, click "Create from File", then specify the
path (if you don't know the path, click on "Browse" command button)

Set your Options

Click "OK"

On the control, set the following Properties:

Enabled = Yes
Locked = False

For additional information on linking and embedding objects, see the help
page titled "Add a picture or object"
 
Back
Top