Identifying bmp on form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a splash screen (frmSplash) that has a jpg graphic on it. If I move
the location of the database and the graphic the form uses, I would like the
program to identify it's new location. In otherwords, if I moved my db
program and the graphic from C:\My Documents to E:\CycleLog I would like the
splash screen graphic in the E:\CycleLog directory to be the reference to the
bitmap location in the forms properties.
Will need all the help and instructions on this one. This is outside my
league...
 
Wylie,
I have a splash screen (frmSplash) that has a jpg graphic on it. If I move
the location of the database and the graphic the form uses,
Maybe I don't understand what you're trying to do, but this should be
pretty straight forward...

Once you've moved the DB AND the PGG to E:\CycleLog, just open frmSplash
in Design mode. Select the Form and under it's properties, edit the
Picture property to E:\CycleLog\GraphicFileName.jpg.
(substitute your graphic file name for GraphicFileName.jpg)

Save the changes, and that should do it.

hth
Al Camp
 
Al,
I am a bicyclist and have developed this program to track all my riding
statistics. Some of my riding friends are interested in having the program to
use themselves. I am going to give (not sell) it to them for the holidays.
The program will be an mde file and they will not have the ability to change
properties on the form so if at all possible, is there a function that can be
written to identify the directory the mde file exists and have the code then
update the property in the form to point to that directory and jpg file?
Thanks
 
Wylie,
First, if you "Imbed" the Jpg instead of "Link" it, then that solves the
problem. The MDE itself would contain the graphic.

If you must keep them separate, then you'll probably have to build a
routine that runs when the user open the MDE for the first time.
You would ask them where they put the MDE file and the Graphic file, and
store their response in a table (ex. "C:\AccessFiles\Bicycle").
Then you could pass that string to the Picture property of your opening
"splash" form.

As I say, I'd try to avoid all that with an imbedded graphic.
hth
Al Camp
 
AlCamp said:
Wylie,
First, if you "Imbed" the Jpg instead of "Link" it, then that
solves the problem. The MDE itself would contain the graphic.

If you must keep them separate, then you'll probably have to
build a routine that runs when the user open the MDE for the first
time. You would ask them where they put the MDE file and the
Graphic file, and store their response in a table (ex.
"C:\AccessFiles\Bicycle"). Then you could pass that string to the
Picture property of your opening "splash" form.

Or just have code in the form's Open event to construct the path to the
picture from the Path property of the CurrentProject object and the name
of the picture file; e.g.,

Me.Image1.Picture = CurrentProject.path & "\Bicycle.jpg"

You don't actually need to store the path to the MDE, because it's
available as a property.
As I say, I'd try to avoid all that with an imbedded graphic.

That does seem the simplest solution.
 
Dirk,
This code is a "keeper".
I've often wanted to know how to tell the Picture property "look in the
directory where the MDB is"
Thanks,
Al Camp
 
AlCamp said:
Dirk,
This code is a "keeper".
I've often wanted to know how to tell the Picture property "look
in the directory where the MDB is"

You're welcome. Be aware that if you are working in Access 97 or
earlier, there's no CurrentProject. In that case, you can parse it out
of CurrentDb.Name, which returns the path *and* name of the database.
 
Back
Top