Fysh
To be able to change the image file location, be it on your pc or the
user's, there is always going to be some 'user' involvement - even if
that
'user' is yourself. The method we use is very simple, it does not involve
going into a query, change the path statement in that query and then run
that query to update the path statement for each table entry. Furthermore
as
the image path location is at a constant location on each pc there is no
need to hold that info per image.
This method does not effect the image file type or suffix because, using
the
example you gave, the image is always stock22.jpg it is on your pc you
would
have the impathpath, within the admin form as D:\PictureLoad\Images
whilst
on the users pc it would be D:\MyDocs\Database\PictureLoad\Images
To add images I think that you would need some code on startup that would
count [A] the number of files in the above image folder, then count
the
records in the existing table, and if there a greater number in the image
folder to run a query to compare the file names of A & B and then run a
append query to add the new image names to the existing table.
Tom
Fysh said:
Tom, thanks for the response. However, I don't think that quite
answers
my
problem, but maybe I might be reading it wrong. I want to reduce the
user
input at all if possible. Are you suggesting just like when you
install
any
software, you tell it where you want it installed? Then this
information
is
kept in the admin table and then when an image is used attach that path
to
the image? That seems possible, but like I said I would rather attempt
to
keep the user involvement very limited. Some places that will use this
is
somewhat computer illiterate and hard headed (hate any changes on
processes).
If you get my meaning. But I might be able to use your suggestion in
the
inital start-up code. But to use this method what about the extensions
of
the
image file? What if they add new pictures to the subfolder, how would
they
be inserted in the table without user involvement? If I can only get
this
part to work I will be happy. Thanks a bunch for your suggestion.
:
Fysh
We had a similar issue & the way we got round it was just to hold the
picture name within the table. An admin form with a bound textbox,
called
ImagePath, to an admin table was produced. Each user is then able
enter
the
local path statement for there pc. Some code is then required on the
OnCurrent event to Dlookup the ImagePath statement from the Admin
table
and
prefix it to the image file name.
Tom
Ok I have the program to actually look at the subfolder where the
database
is
placed. So this will assist those who receive this program. The
remaining
questions I have are, is there a way to programically create a query
to
update my tblPictures to edit where the actual pictures are when
they
first
run the program initially? In other words when this program is sent
out
maybe one of my pictures path is D:\PictureLoad\Images\stock22.jpg,
but
when
the other place it should be D:\My
Docs\Database\PictureLoad\Images\stock22.jpg or something like it.
Also, is there a way to check to see if there are new pics add to
the
subfolder if so then add them to the tblPictures?
Thanks for any input.
:
Ok I figured out part of my questions. I created the subfolder and
place
all
the pictures in there. I then created a subform to allow scrolling
of
the
pictures. I then created 2 tables one for the pictures and one
with
some
text and foreign key to the first table. Then I created a select
button
on
form which places the file shown on the subform in the table
related
to
file
for the form.
My question that I have is since this will be sent to a few places
how
do
I
program the database so it will know the Pics folder is a subfolder
of
PictureLoad (the actual database file) like
C:\PictureLoad\Pics\stock13.jpg?
I figure the only time they will have to get a picture is when they
add
the
picture to the Pics folder. In other words when I create the
database
the
picture files show what is above in a column. However, the next
place
I
send
this to may place the database on a different drive or in another
folder.
But the subfolder will always in the PictureLoad folder. Also,
during
set-up
a routine will have to be performed to update the table to show the
path
to
the actual pictures. I hope this all makes sense. Any help from
anyone
would be appreciated. Thanks in advance.
:
I downloaded the sample posted on the site. It kept wanting to
find
ACMAXB.OCX so I had to remove the missing reference to get it to
work.
Now
the program works great. However, I have few questions to use
this
in
a
program I am creating.
First I want to create a folder with all the pictures available
then
create
a subform next to the Image on frmLoadPictures. On the subform I
was
wondering if it was possible to scroll through the pictures in
the
folder and
once one is found that is needed have it update the Image section
on
the
form? I don't want the user to have to keep going to search for
the
picture
needed and I don't want the picture in the same folder as the
database
but a
subfolder of the databse folder. If the user adds a picture to
the
folder I
would like for it be added when scrolling the subform. Another
question is
that this program will be sent to a few places and I don't want
them
to
have
to edit anything in the database code. I hope this makes sense.
Any
suggestions would be helpful and thanks for making this very
useful
program.
This has already saved me a lot of time. I hope I am not asking
too
much.