A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Adding an image to a form in run time



 
 
Thread Tools Display Modes
  #11  
Old April 29th, 2010, 01:26 AM posted to microsoft.public.access.forms
vinceg
external usenet poster
 
Posts: 7
Default Adding an image to a form in run time

Max_D,
Thanks for the tip. I had looked at DBPix, but this looks even better.
And with my being code-challenged and all, it might be the best option for me.

Still would like to get it working thru the code, though.
Thanks again.
--
vinceg


"Max_D via AccessMonster.com" wrote:

There is the component called AccessImagine, that makes inserting images in
Access database an easy task - users can browse, paste, scan or drag-n-drop
images right to database.

In fact, it can handle all the imaging tasks without any programming.

--
"Be aware of WordPress, it provokes to write bloggy-style..." (c) Gunna

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

.

  #12  
Old April 29th, 2010, 01:31 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Adding an image to a form in run time

I was just offering a thought about the code you were working with. I am not
very familiar with that code, and I don't have time to investigate in detail.
You could do this after setting the value of Result:

result = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

Debug.Print result

After running the code, press Ctrl + G to open the immediate code window.
The value of result should appear there. It needs to be a path that could be
pasted into the Picture property of the image control. If you add the Debug
line and post the value that appears, it may be possible to see what has
occurred.

When I have had to insert an image, here is how I have done it. In a command
button Click event:

Dim strPhoto as String

Me.txtPhotoLink.SetFocus
DoCmd.RunCommand acCmdInsertHyperlink
strPhoto = Nz(Me.txtPhotoLink.Hyperlink.Address, "No photo")
Me.imgPhoto.PictureType = 1 ' Linked
Me.imgPhoto.Picture = strPhoto

Me.Refresh

PhotoLink is a hyperlink field in the form's Record Source table. imgPhoto
is the image control in which the photo is to appear. txtPhotoLink is a text
box, size .01 x .01, formatted the same as the background and tucked away in
a corner of the form, bound to the PhotoLink field. I think the strPhoto
line of code could be:

strPhoto = Me.txtPhotoLink.Hyperlink.Address

I may have added the Nz in case the user closed without selecting an image,
but I don't recall the details, and can't test it just now.

vinceg wrote:
Bruce,
Thanks for the reply.
Once I pasted all the code it workedas intended.
I got the name & path of the file I want displayed on a message box.

In the Click event Sub, I used 'result' ( the name dim'ed in the code) as
follows:
( Me.Image140.Picture = result ), and saved the form.
Pressing the button yielded the message box, but after pressing OK in the
message box, nothing appeared in the image control.
Is that the correct syntax for the image control?
I'm getting closer to understanding the way this works under the forms.
It's quite an education.... thanks.
Did you paste all of the code? ahtAddFilterItem is a function toward the
bottom of the web page link that Douglas provided. Be sure to compile the

[quoted text clipped - 63 lines]

.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

  #13  
Old April 29th, 2010, 02:34 PM posted to microsoft.public.access.forms
vinceg
external usenet poster
 
Posts: 7
Default Adding an image to a form in run time

To all who responded...
Thanks for your help.
The code that Doug pointed me to works perfectly,
(now that I copied all of it - DUH!)
And I figured out how to get the result from the module into
the form that holds the image.
It works like a charm, and the user is a happy camper.
This issue is closed.
Thanks again,
--
vinceg


"vinceg" wrote:

Max_D,
Thanks for the tip. I had looked at DBPix, but this looks even better.
And with my being code-challenged and all, it might be the best option for me.

Still would like to get it working thru the code, though.
Thanks again.
--
vinceg


"Max_D via AccessMonster.com" wrote:

There is the component called AccessImagine, that makes inserting images in
Access database an easy task - users can browse, paste, scan or drag-n-drop
images right to database.

In fact, it can handle all the imaging tasks without any programming.

--
"Be aware of WordPress, it provokes to write bloggy-style..." (c) Gunna

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.