Form Button (Wildcard)

Harry Taylor

Registered User.
Local time
Today, 15:21
Joined
Jul 10, 2012
Messages
90
I have a db with around 3000 records, numbered H1 to H3000.

I also have folders on the system where I keep photos relating to the customer, again numbered H1 to H3000 but with the customer names next to them;
Like H1402 - Jacks Bakery.

Is it possible to have a custom button that would look at the customer number on the database [Text198],
follow a windows path - \\SERVER\Works\Customers\
Open the folder relating to [Text198] with a wildcard at the end

Something like;
\\SERVER\Works\Customers\"[Text198]*"

Any help would be very much appreciated.

Thanks
 
I think you would have to use Dir() to search for the first matching folder before you can open it with something like the FollowHyperlink method.
 
Last edited:
Hi Pat,
Thanks for your reply.

The Windows folders keep correspondence sent by the customer (H1402 - Jacks Bakery). It contains email correspondence, jpg's , safety sheets etc.

I have a hyperlink to open the 'Customer' folder - \\SERVER\Works\Customers - then scroll down to the one im looking at.

I wondered if it was possible to go straight to their folder using the [Text198] field on the db.
 
Why not give your controls some meaningful names instead of Text198? :(

This appears to work, so you can concatenate your Text198 value and add an * to get the folder name

Code:
tt= dir("F:\temp\db1*",vbDirectory)
? tt
db1 Test
 

Users who are viewing this thread

Back
Top Bottom