Drive letter driving me crazy! 
Author Message
 Drive letter driving me crazy!

Hello everyone,

I have a table which has an "image path" field which is used to display
images on a form. The application will be distributed on CD-ROM: the images
will remain on the CD,  but the database itself will be installed on the
users hard drive.

Currently, the image path is something like c:\mydatabase\images\image.bmp

I need a way to update this field to reflect the users CD-ROM drive letter.
My plan was to include a form which will allow the user to input the
required drive letter, and this letter would be used to replace the
existing letter ("c") in the image path field. However, I have no knowledge
of how to code this.

Does anyone have any code similar to this requirement that can pass it
along to a frustrated novice???

Any help is VERY much appreciated.

Regards,

Tom



Sat, 04 Mar 2000 03:00:00 GMT  
 Drive letter driving me crazy!

Tom,

Try:

GenericImagePath = ":\mydatabase\images\"
The user enters NewDriveLetter.
UsersImagePath = [NewDriveLetter] & [GenericImagePath]

or:

ImagePath = "c:\mydatabase\images\"
The user enters NewDriveLetter.
ImagePath = [NewDriveLetter] & Mid([ImagePath],2)

Paul Novitski
Seattle

Quote:
>Subject: Drive letter driving me crazy!

>Date: Tue, 16 Sep 1997 08:04:05 -0700

>Hello everyone,

>I have a table which has an "image path" field which is used to display
>images on a form. The application will be distributed on CD-ROM: the images
>will remain on the CD,  but the database itself will be installed on the
>users hard drive.

>Currently, the image path is something like c:\mydatabase\images\image.bmp

>I need a way to update this field to reflect the users CD-ROM drive letter.
>My plan was to include a form which will allow the user to input the
>required drive letter, and this letter would be used to replace the
>existing letter ("c") in the image path field. However, I have no knowledge
>of how to code this.

>Does anyone have any code similar to this requirement that can pass it
>along to a frustrated novice???

>Any help is VERY much appreciated.

>Regards,

>Tom



Sun, 05 Mar 2000 03:00:00 GMT  
 Drive letter driving me crazy!

Paul,

Many thanks for the input. Now, I have a REALLY stupid question that will
show you why I had so much of a problem with this...

Where do I put this code? I know I have to link the users input with the
update query somehow, but I'm not sure exactly how to do this. Please
excuse my ignorance.

Best Regards,

Tom



Quote:

> Tom,

> Try:

> GenericImagePath = ":\mydatabase\images\"
> The user enters NewDriveLetter.
> UsersImagePath = [NewDriveLetter] & [GenericImagePath]

> or:

> ImagePath = "c:\mydatabase\images\"
> The user enters NewDriveLetter.
> ImagePath = [NewDriveLetter] & Mid([ImagePath],2)

> Paul Novitski
> Seattle



Sun, 05 Mar 2000 03:00:00 GMT  
 Drive letter driving me crazy!

Tom,

There are several places in Access where you can assign the chosen drive
letter to the file name path -- a module, a macro, a query, or a form.  
Which one you choose may depend on where your data resides, where it gets
modified, where it gets output, and how long the information needs to be
retained -- not to mention matters of personal taste and temperament...

Say the user enters the new drive letter in a text or list box called
[DriveLetter], for which you've assigned an OnUpdate event of [Event
Procedure] -- which takes you directly to the module underlying the form,
specifically a subroutine called DriveLetter_AfterUpdate ()  that performs
steps similar to:

Me![ImagePath] = Me![DriveLetter] & Me![GenericImagePath]

...or OnUpdate calls a macro named SetDrive.SetDrivePath that uses the
SetValue action to set [ImagePath] equal to [DriveLetter] & [GenericImagePath].

Alternatively, you could keep the user's drive path and yourown generic
image path in separate places, and join them only when used, such as
setting the source for an image to "[DriveLetter] & [GenericImagePath]" in
the properties of the form or report control.

There are other possibilities, but without knowing the specifics of your
application it's hard for me to speculate as to which would be useful.

Have fun,

Paul

PS:  'There's no such thing as a stupid question' ain't all that bad a
philosophy, if only because asking a question indicates a movement toward
light which all we flatworms know is the highest of vocations.

Quote:
>Many thanks for the input. Now, I have a REALLY stupid question that will
>show you why I had so much of a problem with this...

>Where do I put this code? I know I have to link the users input with the
>update query somehow, but I'm not sure exactly how to do this. Please
>excuse my ignorance.

>Best Regards,

>Tom



Thu, 09 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Retrieving drive letter for user's cd-rom drive

2. Determining drive letter assigned to floppy drive?

3. local drive letter <> drive share name

4. DAO is driving me crazy

5. sql / vba driving me crazy!

6. sql /VBA driving me crazy!

7. The syntax in Access is driving me crazy.

8. HELP a form is driving me crazy!!!

9. Database Query - Driving me crazy!

10. ComboBox Binding Driving Me Crazy

11. DataGrid Driving Me Crazy

12. Packing - Driving me CRAZY!

 

 
Powered by phpBB® Forum Software