A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I add a filename to database using browse?



 
 
Thread Tools Display Modes
  #1  
Old March 7th, 2007, 11:19 PM posted to microsoft.public.access.forms
rlpmaverick
external usenet poster
 
Posts: 1
Default How do I add a filename to database using browse?

(WinXP Access2003)
I need a simple way to add a command button to a form that will open a
browse window and, upon finding the desired file, put the path and filename
into a field in my database. Any help in this area would be wonderful.
Thanks.
  #2  
Old March 7th, 2007, 11:28 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default How do I add a filename to database using browse?

Using the API is the most version resistant.
http://www.mvps.org/access/api/api0001.htm

rlpmaverick wrote:
(WinXP Access2003)
I need a simple way to add a command button to a form that will open a
browse window and, upon finding the desired file, put the path and filename
into a field in my database. Any help in this area would be wonderful.
Thanks.


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #3  
Old March 8th, 2007, 02:25 AM posted to microsoft.public.access.forms
Anthos
external usenet poster
 
Posts: 88
Default How do I add a filename to database using browse?

Add the following code to your Button.

Private Sub Command0_Click()
Dim strFileName As String
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Show
strFileName = .SelectedItems(1)
End With

Me.FilePathField.value = strFileName

End Sub


This code will require a reference to the Microsoft Office Object
Library (in your case it would be Microsoft Office 11.0 Object
Library)

Hope this Helps

Regards
Anthony

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.