add image file to a form on open event

eshai

Registered User.
Local time
Today, 06:20
Joined
Jul 14, 2015
Messages
195
hi:
i have a popup form that have attachment control. record source is "tempimage"table
the image is taking from a folder c:/img and there is only one file in the folder at a time
i want the file to be loaded automatic to the form control when the form open
file ext'=gif
(the file are deleted from table after printed by code)
'bdw' I wish there was another way to do it
 
Not sure what your question is.
You can load a picture into an image control just by using its path

image0.picture = "c:\xxx\yyy\picture.gif"

No tables are required.
 
hi:
i have a popup form that have attachment control. record source is "tempimage"table
the image is taking from a folder c:/img and there is only one file in the folder at a time
i want the file to be loaded automatic to the form control when the form open
file ext'=gif
(the file are deleted from table after printed by code)
'bdw' I wish there was another way to do it

To load the image file into the form control you simply do
Code:
Me.MyControl.Picture = "c:\img\myfile.gif"
where MyControl is the name of the form control and myfile is is the name of your image file. You will need to set the picture property to "" before you zap the file if the form is still open.

Best,
Jiri
 
Not sure what your question is.
You can load a picture into an image control just by using its path

image0.picture = "c:\xxx\yyy\picture.gif"

No tables are required.

thanx for the reply
The image name changes each time and its have to be "on form load" procedure
 
thanx for the reply
The image name changes each time and its have to be "on form load" procedure

I get it:

Code:
Private Sub GetPic
   Dim Myfile as String
   'will get the first file in the directory
   Myfile = Dir(c:\img\*.*)
   MyControl.Picture = myfile 
End Sub

Jiri
 
Last edited:
thanx jiri your code did the job
no problem. Look at the second post I sent. You can change the file in the folder and it will be retrieved by a call to the Sub GetPic (from OnLoad event)

Best,
Jiri
 

Users who are viewing this thread

Back
Top Bottom