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. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
Adding an image to a form in run time
I have an application which enables the user to enter the parameters of a new
project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg |
#2
|
|||
|
|||
Adding an image to a form in run time
Use an image control. In your button's code, use:
Me.ImageControlname.Picture = "C:\PathToNew\Pic.jpg" It's that simple. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "vinceg" wrote in message ... I have an application which enables the user to enter the parameters of a new project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg |
#3
|
|||
|
|||
Adding an image to a form in run time
Arvin,
Thanks for the quick response. The problem is I do not know the path to the image at design time. Actually, the pictures haven't been taken yet. I want the users to be able to click a button and have a browse dialog box apper that will allow them to select the appropriate image to be placed in the control. Thanks again, vince g -- vinceg "Arvin Meyer [MVP]" wrote: Use an image control. In your button's code, use: Me.ImageControlname.Picture = "C:\PathToNew\Pic.jpg" It's that simple. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "vinceg" wrote in message ... I have an application which enables the user to enter the parameters of a new project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg . |
#4
|
|||
|
|||
Adding an image to a form in run time
Arvin,
Do you have any additional information on this issue, beyond your initial response? As I mentioned in my last post, I am looking for a way to allow users to bring up a dialog box using a button on the form to browse their files for the picture. The pictures I want to add to the image control would be retrieved from the user's file system (C:/userfolder/). Thanks again, -- vinceg "Arvin Meyer [MVP]" wrote: Use an image control. In your button's code, use: Me.ImageControlname.Picture = "C:\PathToNew\Pic.jpg" It's that simple. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "vinceg" wrote in message ... I have an application which enables the user to enter the parameters of a new project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg . |
#5
|
|||
|
|||
Adding an image to a form in run time
Use the code in http://www.mvps.org/access/api/api0001.htm at "The Access
Web" to bring up the Windows File Open dialog box to allow them to select the file. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "vinceg" wrote in message ... Arvin, Do you have any additional information on this issue, beyond your initial response? As I mentioned in my last post, I am looking for a way to allow users to bring up a dialog box using a button on the form to browse their files for the picture. The pictures I want to add to the image control would be retrieved from the user's file system (C:/userfolder/). Thanks again, -- vinceg "Arvin Meyer [MVP]" wrote: Use an image control. In your button's code, use: Me.ImageControlname.Picture = "C:\PathToNew\Pic.jpg" It's that simple. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "vinceg" wrote in message ... I have an application which enables the user to enter the parameters of a new project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg . |
#6
|
|||
|
|||
Adding an image to a form in run time
Doug,
Thank you for the response. I'm not an expert coder...... I pasted the code into a new function from the site you mentioned, and called the function from a command button: "---- Function TestIt() Dim strFilter As String Dim lngFlags As Long strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _ "*.MDA;*.MDB") strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF") strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT") strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*") ' Uncomment this line to try the example ' allowing multiple file names: ' lngFlags = ahtOFN_ALLOWMULTISELECT Or ahtOFN_EXPLORER Dim result As Variant result = ahtCommonFileOpenSave(InitialDir:="C:\", _ Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _ DialogTitle:="Hello! Open Me!") If lngFlags And ahtOFN_ALLOWMULTISELECT Then If IsArray(result) Then Dim i As Integer For i = 0 To UBound(result) MsgBox result(i) Next i Else MsgBox result End If Else MsgBox result End If ' Since you passed in a variable for lngFlags, ' the function places the output flags value in the variable. Debug.Print Hex(lngFlags) End Function -- " Got "Sub or Function not defined" error for "ahtAddFilterItem".... Have no idea what to do with this message..... This may be way beyond my level of coding expertise, but I can't believe there isn't a run-time control that that works the same as the design time control when you want to embed an file into an image. I looked in MS for info on this, but don't know where to start. I could use some help that acknowledges my relatively low level of technical experience. Thanks, vinceg "Douglas J. Steele" wrote: Use the code in http://www.mvps.org/access/api/api0001.htm at "The Access Web" to bring up the Windows File Open dialog box to allow them to select the file. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "vinceg" wrote in message ... Arvin, Do you have any additional information on this issue, beyond your initial response? As I mentioned in my last post, I am looking for a way to allow users to bring up a dialog box using a button on the form to browse their files for the picture. The pictures I want to add to the image control would be retrieved from the user's file system (C:/userfolder/). Thanks again, -- vinceg "Arvin Meyer [MVP]" wrote: Use an image control. In your button's code, use: Me.ImageControlname.Picture = "C:\PathToNew\Pic.jpg" It's that simple. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "vinceg" wrote in message ... I have an application which enables the user to enter the parameters of a new project, which will help size the project and estimate a cost. As part of the application, I want to add an image of the finished product. I've ried every combinatin of controls: image, bound & unbound objects, but have not found the solution. The ideal situation would be to have a default image on the form, with a button that would trigger code to allow the user to browse for a different picture, and replace the original. It could be a link relationship to the picture, but the application is not very large, so the images could be embedded. Any help is appreciated. Thanks, vinceg. -- vinceg . . |
#7
|
|||
|
|||
Adding an image to a form in run time
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 code (Debug Compile) after you paste it into your code module. vinceg wrote: Doug, Thank you for the response. I'm not an expert coder...... I pasted the code into a new function from the site you mentioned, and called the function from a command button: "---- Function TestIt() Dim strFilter As String Dim lngFlags As Long strFilter = ahtAddFilterItem(strFilter, "Access Files (*.mda, *.mdb)", _ "*.MDA;*.MDB") strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF") strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT") strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*") ' Uncomment this line to try the example ' allowing multiple file names: ' lngFlags = ahtOFN_ALLOWMULTISELECT Or ahtOFN_EXPLORER Dim result As Variant result = ahtCommonFileOpenSave(InitialDir:="C:\", _ Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _ DialogTitle:="Hello! Open Me!") If lngFlags And ahtOFN_ALLOWMULTISELECT Then If IsArray(result) Then Dim i As Integer For i = 0 To UBound(result) MsgBox result(i) Next i Else MsgBox result End If Else MsgBox result End If ' Since you passed in a variable for lngFlags, ' the function places the output flags value in the variable. Debug.Print Hex(lngFlags) End Function -- " Got "Sub or Function not defined" error for "ahtAddFilterItem".... Have no idea what to do with this message..... This may be way beyond my level of coding expertise, but I can't believe there isn't a run-time control that that works the same as the design time control when you want to embed an file into an image. I looked in MS for info on this, but don't know where to start. I could use some help that acknowledges my relatively low level of technical experience. Thanks, vinceg Use the code in http://www.mvps.org/access/api/api0001.htm at "The Access Web" to bring up the Windows File Open dialog box to allow them to select [quoted text clipped - 44 lines] . -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/201004/1 |
#8
|
|||
|
|||
Adding an image to a form in run time
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 |
#9
|
|||
|
|||
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 . |
#10
|
|||
|
|||
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 | |
|
|