Copying a image

  • Thread starter Thread starter rap43
  • Start date Start date
R

rap43

Using a form in access 2002
I need to browse to a jpg image and copy that image to a folder. I have a
command button to named browse but I can not get the code correct.
 
Hi there,

You've provided not much info, so therefore some questions:
Is the jpg file name and location known or does it change every day/hour/week?
Is the destination folder known or does it change too?

Here's what I would do:
1) retrieve the source folder path - that info is either stored somewhere in
your database or use the return value of the open file dialog
2) if the jpg file name is stored somewhere in your database, retrieve it,
otherwise get it via the open file dialog method from item 1
3) retrieve the destination folder path - again this info is either stored
or the user points to the folder via the open folder dialog.
4) should the file name stay the same once it is copied to the destination
folder?
If not you need to know the new file name.

Once you have the above info it's a matter of using the Copy method.
Simpy type Copy into your VBA code and you'll see the arguments. Otherwise
press help to get code samples.

I hope this helps.
Cheers
Michael
 
Thanks Michael

The destination folder is know but not the location of the image, I need to
browse to the image and copy it to a know folder. I like the end user to
click the browse button and find the image and then click copy. This will
lanuch another form to add
data related to the image.

Thanks again
 
Back
Top