?
Solved

Browse to file, Insert in form as a hyperlink

Posted on 2003-11-24
11
Medium Priority
?
381 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 39

Expert Comment

by:stevbe
ID: 9810407
0
 

Author Comment

by:BernieTay
ID: 9816496
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
ID: 9816497
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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 39

Expert Comment

by:stevbe
ID: 9817265
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
ID: 9823238
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
 
LVL 39

Accepted Solution

by:
stevbe earned 600 total points
ID: 9824339
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
ID: 9824550
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
ID: 9826081
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
ID: 9830432
Excellent Job; It worked for me

Many Thanks

Bernie
0
 

Expert Comment

by:param7pd
ID: 9915108
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
ID: 9915127
param7pd, please open your own question as this one is already closed
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

649 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