
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