By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,806 Members | 1,506 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,806 IT Pros & Developers. It's quick & easy.

Using a Button to search a file and save it on a field

Neo69ADSL
P: 4
Hello to all. First of all, if there is any mistakes in writting, i'm sorry but i'm portuguese and my english isn't very good.

This is my problem. I'm making an Access Database and i'm trying to make an html page directly from access to work on my DB, but the problem is this:

* First of all, i'm a newbee in access, so if you could explain step by step, i would appreciate much.

* I'm trying to put a button on a access html page so that i can search a file, and when i select that file, the full path of the file could be stored in a field, and if the field as already a path that when i click on it, it could open the file itself.

As I said before, i'm sorry for my english.

Thanks in advance...
Oct 16 '07 #1
Share this Question
Share on Google+
7 Replies


P: 76
Are you trying to do a hyperlink? If you are, you need to add a button that will go to the code I give you, and place it were your hyperlink is going to be displayed.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Name_of_button_Click()
  2.  
  3.     Me.[Name_of_feild].SetFocus
  4.     On Error GoTo browse_stop
  5.     RunCommand acCmdInsertHyperlink
  6. Name_of_button_stop:
  7.  
  8. End Sub
  9.  
Now this is done for the form you need it in. Will that take care of what your wanting?

Brian
Oct 16 '07 #2

Neo69ADSL
P: 4
Are you trying to do a hyperlink? If you are, you need to add a button that will go to the code I give you, and place it were your hyperlink is going to be displayed.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Name_of_button_Click()
  2.  
  3.     Me.[Name_of_feild].SetFocus
  4.     On Error GoTo browse_stop
  5.     RunCommand acCmdInsertHyperlink
  6. Name_of_button_stop:
  7.  
  8. End Sub
  9.  
Now this is done for the form you need it in. Will that take care of what your wanting?

Brian
Hello Brian.

Thanks for your help, but i can't put this to work. Can you tell me step by step where i have to do this? Sorry for the ignorance but i'm new in Access, i've tried to put your code in a button or directly on onclick for the field "Foto Amostra", witch is the hyperlink field that i'm using.
But i couldn't make this to work.

Thanks in advance for your help.
Oct 17 '07 #3

P: 76
do you have a form created from a table? If so, you need to add a Field in the table in the design view, and select hyperlink instead of text. Next you need to create a text box in your form pointing to that hyperlink Field. This is done by clicking on properties of the text box, and the control source needs to have the same title as the Field. Then a button needs to be added, click on properties and go to on click, and click the button "..." next to the on click. This will open VBasic. Enter the code I gave you replacing the name of the textbox with the one you chose.
Oct 17 '07 #4

Neo69ADSL
P: 4
do you have a form created from a table? If so, you need to add a Field in the table in the design view, and select hyperlink instead of text. Next you need to create a text box in your form pointing to that hyperlink Field. This is done by clicking on properties of the text box, and the control source needs to have the same title as the Field. Then a button needs to be added, click on properties and go to on click, and click the button "..." next to the on click. This will open VBasic. Enter the code I gave you replacing the name of the textbox with the one you chose.
Hello Again Brian...

I've followed what you said step by step, but when i click on the button it gave me this.



I would also like put this that we are trying to do on a html access page, is it possible?

Thanks Again for your help and your pacience with a newbie...
Oct 18 '07 #5

P: 76
I'm sorry, I forgot to change the name of browse_stop. replace it with the name of your button_stop. I am not sure because I am considered a newbie as well. I just figured out this code and I don't mind sharing it with someone that needs it as well.
Oct 18 '07 #6

Neo69ADSL
P: 4
I'm sorry, I forgot to change the name of browse_stop. replace it with the name of your button_stop. I am not sure because I am considered a newbie as well. I just figured out this code and I don't mind sharing it with someone that needs it as well.
Brian, You're THE MAN ...
Worked just fine!!!! Many many thanks...

Just one more thing, do you know how to use this on a html access page?

Many thanks again...
Oct 19 '07 #7

P: 76
As far as the HTML, I'm not quite sure, but your welcome for the code.

Brian
Oct 22 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.