Solved

Browse to file, Insert in form as a hyperlink

Posted on 2003-11-24
11
367 Views
Last Modified: 2008-03-10
HI
I want to be able to let a user browse to a file from an Access 2000 form, On selecting a file the full path would be saved to the underlying table, and preferably display on the form as a hyperlink, though my main concern is being able to browse,select and save the full path of a file.
I would be happy if I could get it to just save as text, without the hyperlink.
This is a fairly urgent request, and I have only just scratched the surface of Access so please make all answers in dummy format; preferably with an example.
Many Thanks
0
Comment
Question by:BernieTay
  • 5
  • 5
11 Comments
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
0
 

Author Comment

by:BernieTay
Comment Utility
Hmmm OK but what does it mean/do?
I would prefer not to blindly copy, and have a clue as to exactly what it all does. Really I spose I am looking for guru, to hold my hand through the process.
0
 

Author Comment

by:BernieTay
Comment Utility
Hmmm OK but what does it mean/do?
I would prefer not to blindly copy, and have a clue as to exactly what it all does. Really I spose I am looking for guru, to hold my hand through the process.
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
the only thing that code does is wrap up the Win32 api call to open the standard file dialog box and returns a string of the full path and name of the file selected.
0
 

Author Comment

by:BernieTay
Comment Utility
OK so thats what it does; but how does it help me in my scenario and how do I use it?
Where does what code go
How do I call the code
How do I assign the resulting file to the text box in my access form
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 39

Accepted Solution

by:
stevbe earned 150 total points
Comment Utility
copy the code into a new standard module.
make a button on your form and call it cmdFindFile
change the OnClick property of the cmdFindFile to [Event Procedure]
click the little builder button (...) to the right of the OnClick property, this will take you to the code window and will already provide the event stub for you.

Private Sub cmdFileFind_Click()

End Sub

now add the following code to allow a user to open the dialog box and put the resulting file path into a textbox called
txtFilePath

Private Sub cmdFileFind_Click()
    Me.txtFilePath.Value = ahtCommonFileOpenSave(InitialDir:="C:\", DialogTitle:="Hello! Open Me!")
End Sub

Steve

0
 

Author Comment

by:BernieTay
Comment Utility
Ahh thats better nice and dummy-fied just how I like it;  and this will save the path in the underlying table?
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
Someimes it is hard to determine exactly how much help someone is looking for :-)

As long as your textbox is bound to the field in your table ... the control source of the textbox property has the field name and the form's Recordsource is the name of the table or a query that is based on that table you should be good to go.

Steve

0
 

Author Comment

by:BernieTay
Comment Utility
Excellent Job; It worked for me

Many Thanks

Bernie
0
 

Expert Comment

by:param7pd
Comment Utility
Hello Steve,
I want to show .jpg files on form. Using your code, I select .jpg file. Now how I could show it on form? I tried it with Bound Ole Object, but it didn't work. Could you advice?
Thanks,
Paresh
0
 
LVL 39

Expert Comment

by:stevbe
Comment Utility
param7pd, please open your own question as this one is already closed
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now