Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to upload picture? 1

Status
Not open for further replies.

shelbytll

Programmer
Dec 7, 2001
135
SG
Hi,
I'm developing an application that is to be run on individual PC. Both the application and database are in their own laptop.

I would like to allow user to Upload picture to the database. How do I do that? Do I use the Command Button? I am a clever newbie...[peace]
 
Create a general field in the database and in the form, use the Image tool. Make a reference to it
 
Hi Victor F. Rodriguez,
my database fields are done.

Just need to display on the form updon user selection.

In the click event of a combo box, I tried:

select Imgsrc from Img where Model=thisform.model.value into cursor tempcur
THISFORM.photo.Picture = tempcur.Imgsrc


And on the form, I place an Image control with the name "photo".

But when I run the form, the error says: Operation is invalid for a General field. I am a clever newbie...[peace]
 

".Picture" property should point to a text file addressing the location of a certain picture file. for example:

thisform.mypic.picture = "c:\my documents\mypic.jpg"

Considering that "mypic" is an OLE object, you may try this:

thisform.mypic.controlsource = mytable.anypic

where "mytable" is the DBF and "anypic" is the general field.

torturedmind [trooper]

"It is much better to ask shallow questions than wander in the depths of ignorance..."
 
Hi torturedmind,
I have tried to place an OLE Bound Control on the form with name "photo".

Then in the click event of a combo box, I code:

select Imgsrc from Img where Model=thisform.model.value into cursor tempcur
thisform.photo.controlsource= Img.Imgsrc


But it still come out with the error: Operation is invalid for a General field I am a clever newbie...[peace]
 
then replace

thisform.photo.controlsource = Img.Imgsrc

with

thisform.photo.controlsource = tempcur.Imgsrc

then refresh the control.


torturedmind [trooper]

"It is much better to ask shallow questions than wander in the depths of ignorance..."
 
I tried that too, but still the same. I am a clever newbie...[peace]
 

sorry, forgot to include the double-quotations:

thisform.photo.controlsource = "tempcur.Imgsrc"

torturedmind [trooper]

"It is much better to ask shallow questions than wander in the depths of ignorance..."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top