Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2006

Tip: Looking for answers? Try searching our database.

How do I link a bitmap to a bound object frame ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MikeT - 09 Feb 2006 18:21 GMT
I have a continuous form to select a country and i want to add a small bitmap
flag to each.  How can I link a bound object frame to each bitmap, when the
bound object frame does not seem to offer a suitable event on which to hang
VBA?
Stephen Lebans - 10 Feb 2006 03:28 GMT
I think you would have to create a seperate table with two fields. An
indexed key field representing the Country code and an OLE object field
where you would embed the small graphic for the respective flag.
Use a Query to produce the recordsource for the form linking each row from
your main table to the "Flags" table containing the Bitmap.

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

>I have a continuous form to select a country and i want to add a small
>bitmap
[quoted text clipped - 3 lines]
> hang
> VBA?
MikeT - 10 Feb 2006 09:43 GMT
Stephen, thank you, but that still means embedding the bitmaps within the
database.  Is there a way of linking the bound object frame to and external
set of bitmaps?

> I think you would have to create a seperate table with two fields. An
> indexed key field representing the Country code and an OLE object field
[quoted text clipped - 9 lines]
> > hang
> > VBA?
Stephen Lebans - 10 Feb 2006 12:29 GMT
For a form in Continuous view, the only method available involves the use of
a Bound OLE Frame control, and as you surmised, embedded Images.

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

> Stephen, thank you, but that still means embedding the bitmaps within the
> database.  Is there a way of linking the bound object frame to and
[quoted text clipped - 15 lines]
>> > hang
>> > VBA?
MikeT - 14 Feb 2006 09:19 GMT
Stephen, then the next question is how do I mimic drag and drop in VBA?  If I
drag a bitmap into the table in datasheet view, it says "Bitmap Image" and
displays correctly in a form, but if I set the cell equal to the path and
file name of the bitmap in VBA, the table says "Binary Information" and will
only display a blank.
Mike

> For a form in Continuous view, the only method available involves the use of
> a Bound OLE Frame control, and as you surmised, embedded Images.
[quoted text clipped - 18 lines]
> >> > hang
> >> > VBA?
Stephen Lebans - 14 Feb 2006 16:58 GMT
What is it exactly you want to do?

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

> Stephen, then the next question is how do I mimic drag and drop in VBA?
> If I
[quoted text clipped - 33 lines]
>> >> > hang
>> >> > VBA?
MikeT - 15 Feb 2006 16:10 GMT
I have a folder full of flags each drawn as a bitmap.  When I enter a new
country into the Access database, I want to write a piece of software in VBA
to display the folder and the flags inside, then allow the user to select one
flag and have it automatically embedded in the relevant Access table in the
correct place.  The first two bits I can do, it is purely the embeddidng of
an external bitmap that is causing a problem.
Mike

> What is it exactly you want to do?
>
[quoted text clipped - 35 lines]
> >> >> > hang
> >> >> > VBA?
Stephen Lebans - 15 Feb 2006 22:50 GMT
It's nothing to programmatically insert the Bitmap file into the OLE field.
Here's a sample for a Word Doc. You'll have to change it support MS Paint
BMP's instead which would be class "Paint.Picture". As teh sampel indicates,
you will need a Bound OLE Frame control on your form. You can make it hidden
if you don't want the user to see it at this point in your UI.

Private Sub cmdOLEAuto_Click()
  On Error GoTo Error_cmdOLEAuto_Click
  With Me![OLEWordDoc]
     .Enabled = True
     .Locked = False
     ' Specify what kind of object can appear in the field.
     .OLETypeAllowed = acOLEEmbedded
     ' Class statement for Word document.
     .Class = "Word.Document"
     ' Specify the file to be embedded.
     ' Type the correct path name.
     .SourceDoc = "c:\<pathname>\TestOLEAuto.doc"
     ' Create the embedded object.
     .Action = acOLECreateEmbed
     ' Optional size adjustment.
     .SizeMode = acOLESizeZoom
  End With
Exit_cmdOLEAuto_Click:
  Exit Sub
Error_cmdOLEAuto_Click:
  MsgBox CStr(Err) & " " & Err.Description
  Resume Exit_cmdOLEAuto_Click
End Sub

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

>I have a folder full of flags each drawn as a bitmap.  When I enter a new
> country into the Access database, I want to write a piece of software in
[quoted text clipped - 55 lines]
>> >> >> > hang
>> >> >> > VBA?
MikeT - 20 Feb 2006 10:44 GMT
Stephen, that is fine: I can now use VBA to display the flag in an unbound
frame on a form, and I can even copy the flag to the Clipboard if I add
".Action acOLECopy" to your code, but how can I use VBA to embed that flag
into an OLEobject field of a table?  Though I can drag and drop the image
manually, there are over 250 flags in my table and I want to be able to
update the table automatically.  If I am to display the flags beside the
relevant country names on a continuous form I believe there is no alternative
but to embed them in the table (please see my original question).

> It's nothing to programmatically insert the Bitmap file into the OLE field.
> Here's a sample for a Word Doc. You'll have to change it support MS Paint
[quoted text clipped - 85 lines]
> >> >> >> > hang
> >> >> >> > VBA?
McFestoe - 20 Feb 2006 23:03 GMT
Mike

I have just found your thread and are at the moment trying to do what i
think you have acheived, did you get it working with the above code or did
you have to change it, VBA code is a new thing to me and i seam to be
leaning all the time.

What iam trying to do is store electonic service sheets with the customers
signature on, so i can get rid of some paperwork and store thing
electronically, could you let me know how far you have got and how you have
done it.

Thanks

Rich

> Stephen, that is fine: I can now use VBA to display the flag in an unbound
> frame on a form, and I can even copy the flag to the Clipboard if I add
[quoted text clipped - 112 lines]
>> >> >> >> > hang
>> >> >> >> > VBA?
MikeT - 21 Feb 2006 10:40 GMT
Please see my answer to Stephen Lebans below.  I can now search a folder of
bitmaps outside Access, copy the images into an Access table and display them
alongside the relevant table entries in a continuous form.  The code provided
by Stephen worked perfectly - I just applied it wrongly at first.  Mike

> Mike
>
[quoted text clipped - 128 lines]
> >> >> >> >> > hang
> >> >> >> >> > VBA?
Stephen Lebans - 20 Feb 2006 23:29 GMT
Did you try the code I posted with an OLE Frame control BOUND to an OLE
field?

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

> Stephen, that is fine: I can now use VBA to display the flag in an unbound
> frame on a form, and I can even copy the flag to the Clipboard if I add
[quoted text clipped - 112 lines]
>> >> >> >> > hang
>> >> >> >> > VBA?
MikeT - 21 Feb 2006 10:38 GMT
My mistake!  I used your code with an UNBOUND Frame - it worked perfectly but
did nothing to the original table.  I shall now try the same code with a
bound frame, which I understand will then amend the table to which it is
bound!  Thank you for your help - I think I have just about solved my
problem.  Mike

> Did you try the code I posted with an OLE Frame control BOUND to an OLE
> field?
[quoted text clipped - 115 lines]
> >> >> >> >> > hang
> >> >> >> >> > VBA?
bekiss - 13 Feb 2006 13:51 GMT
I'm attempting to do something very similar.  How do you embed the bitmap
image in the OLE Object field for each record in the table?

> I think you would have to create a seperate table with two fields. An
> indexed key field representing the Country code and an OLE object field
[quoted text clipped - 9 lines]
> > hang
> > VBA?
Stephen Lebans - 13 Feb 2006 15:45 GMT
Have you looked in the Access Help file?

Open the table table containing an OLE field. RIght Click on the field and
select insert object.

I would make every bitmap a MS Paint object. This is important if you will
distributing your application to other desktops.

Signature

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.

> I'm attempting to do something very similar.  How do you embed the bitmap
> image in the OLE Object field for each record in the table?
[quoted text clipped - 13 lines]
>> > hang
>> > VBA?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.