>OK..the deal is, like this.
>
>Im making a form were the user can add some pictures.
>
>For this I have a Memo field and I just can get the code right, I mean I have a botton were is says add pic. Here is were I want to put the code so the user can add the pic. Is this right??
>
>AND CAN ANYBODY TELL ME WHAT CODE IT HAS TO BE IN THE BOTTON ???
>
>
>
>Thanks Ya'll...
>
>Dont Hate NEWBIESAlex:
Nobody here hates newbies. In fact we are very friendly and we even have a VFP Spanish section for you, if you prefer to ask in Spanish.
But there is no need to shout. That is bad netiquette. (UPPERCASE looks like shouting).
Now, to your questions.
There are some problems with your idea.
First of all, you should not use memo fields to store pictures. They tend to grow immensely. It is much better to have a subfolder where you store pictures directly as files (jpg, gif, etc).. All you need to do is have a simple text field in your table, that indicates the path and filename to link to each picture.
As for the code, you could ask the user to supply the file name, maybe using
GetDir()
to point to the file, then
Copy File
to copy or move it to your picture folder (destination).
Lastly, even though it works, reusability rules inOOP, say that generally you should not put code like this in a command button, but have the button call a method in the form or other generic object, to do the work. This way, you can have a button that asks for a file, and depending on the situation it could be a picture, a file to print, a text file, or whatever. The form should be the one to know in every case.
HTH