Control for Browsing to network location

  • Thread starter Thread starter Kassy
  • Start date Start date
K

Kassy

Hello!

I want to be able to enter a network folder location, by clicking through a
directory tree and selecting the folder I want. I currently have the
"Network Location" column hyperlinked, but typing in a network location
that's over 7 folders deep is getting old fast.

Any suggestions?

Thank you!
 
Great. Thanks for the link. Lot's of nice tools in there.

I'll work on figuring out how to attach the code to the command button now.
I've got the button in place, I right-click on it and goto code builder, and
then I paste the code under the 'Private Sub Command33_Click()', but when I
run it I get errors.

I have the 'Microsoft Office 9.0 Object Library' enabled as noted. Not sure
which way to go now.
:-)

Kassy.
 
The API call can look scary if you have not worked with them before.

Everthing before the line:
Public Function BrowseFolder(
needs to go at the top of your module - with the Option statements.

The function can go anywhere in the module: top is fine.

The Click event procedure of your command button then calls the function,
and uses the return value, e.g.:
Private Sub Command0_Click()
Dim strFolder As String
strFolder = BrowseFolder("Where is it?")
MsgBox "You chose " & strFolder
End Sub
 
Alright. I've got the the button on the form working, in the sense that it
pops up the 'file search' window. This all works without any error message.
The only remaining problem is that I'm trying to figure out how to take the
selected value and have it stored in in the box above it.

Right now, the box where I want the network location value to appear reads:
'=BrowseFolder([<<szDialogTitle>>])'

Kassy
 
Assign the return value to the text box:
Me.[SomeTextBox] = BrowseFolder("Where's that?")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Kassy said:
Alright. I've got the the button on the form working, in the sense that it
pops up the 'file search' window. This all works without any error message.
The only remaining problem is that I'm trying to figure out how to take the
selected value and have it stored in in the box above it.

Right now, the box where I want the network location value to appear reads:
'=BrowseFolder([<<szDialogTitle>>])'

Kassy

Allen Browne said:
The API call can look scary if you have not worked with them before.

Everthing before the line:
Public Function BrowseFolder(
needs to go at the top of your module - with the Option statements.

The function can go anywhere in the module: top is fine.

The Click event procedure of your command button then calls the function,
and uses the return value, e.g.:
Private Sub Command0_Click()
Dim strFolder As String
strFolder = BrowseFolder("Where is it?")
MsgBox "You chose " & strFolder
End Sub


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

builder,
and when Not
sure
 
It works! (but the box pops up twice).

1.) I click the command button
2.) The browse windows appears
3.) I select folder, hit ok
4.) Message dialog informing of location appears
5.) I hit 'OK'
6.) Browse window appears again
7.) I select folder location again
8.) I hit 'OK'
9.) The location is stored correctly in the text box


Allen Browne said:
Assign the return value to the text box:
Me.[SomeTextBox] = BrowseFolder("Where's that?")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Kassy said:
Alright. I've got the the button on the form working, in the sense that it
pops up the 'file search' window. This all works without any error message.
The only remaining problem is that I'm trying to figure out how to take the
selected value and have it stored in in the box above it.

Right now, the box where I want the network location value to appear reads:
'=BrowseFolder([<<szDialogTitle>>])'

Kassy

Allen Browne said:
The API call can look scary if you have not worked with them before.

Everthing before the line:
Public Function BrowseFolder(
needs to go at the top of your module - with the Option statements.

The function can go anywhere in the module: top is fine.

The Click event procedure of your command button then calls the function,
and uses the return value, e.g.:
Private Sub Command0_Click()
Dim strFolder As String
strFolder = BrowseFolder("Where is it?")
MsgBox "You chose " & strFolder
End Sub


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Great. Thanks for the link. Lot's of nice tools in there.

I'll work on figuring out how to attach the code to the command button
now.
I've got the button in place, I right-click on it and goto code builder,
and
then I paste the code under the 'Private Sub Command33_Click()', but when
I
run it I get errors.

I have the 'Microsoft Office 9.0 Object Library' enabled as noted. Not
sure
which way to go now.
:-)

Kassy.


The standard File Open dialog in Windows allows you to navigate to
Network
Neighbourhood and choose a folder.

The code to do that is in this link:
http://www.mvps.org/access/api/api0002.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hello!

I want to be able to enter a network folder location, by clicking
through
a
directory tree and selecting the folder I want. I currently
have
the
"Network Location" column hyperlinked, but typing in a network
location
that's over 7 folders deep is getting old fast.
 
So, you have the "BrowseFolder(..." bit twice in your code, or else your
mouse is causing the Click event to fire twice?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Kassy said:
It works! (but the box pops up twice).

1.) I click the command button
2.) The browse windows appears
3.) I select folder, hit ok
4.) Message dialog informing of location appears
5.) I hit 'OK'
6.) Browse window appears again
7.) I select folder location again
8.) I hit 'OK'
9.) The location is stored correctly in the text box


Allen Browne said:
Assign the return value to the text box:
Me.[SomeTextBox] = BrowseFolder("Where's that?")

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
Kassy said:
Alright. I've got the the button on the form working, in the sense
that
it
pops up the 'file search' window. This all works without any error message.
The only remaining problem is that I'm trying to figure out how to
take
the
selected value and have it stored in in the box above it.

Right now, the box where I want the network location value to appear reads:
'=BrowseFolder([<<szDialogTitle>>])'

Kassy

The API call can look scary if you have not worked with them before.

Everthing before the line:
Public Function BrowseFolder(
needs to go at the top of your module - with the Option statements.

The function can go anywhere in the module: top is fine.

The Click event procedure of your command button then calls the function,
and uses the return value, e.g.:
Private Sub Command0_Click()
Dim strFolder As String
strFolder = BrowseFolder("Where is it?")
MsgBox "You chose " & strFolder
End Sub


--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Great. Thanks for the link. Lot's of nice tools in there.

I'll work on figuring out how to attach the code to the command button
now.
I've got the button in place, I right-click on it and goto code builder,
and
then I paste the code under the 'Private Sub Command33_Click()', but
when
I
run it I get errors.

I have the 'Microsoft Office 9.0 Object Library' enabled as noted. Not
sure
which way to go now.
:-)

Kassy.


The standard File Open dialog in Windows allows you to navigate to
Network
Neighbourhood and choose a folder.

The code to do that is in this link:
http://www.mvps.org/access/api/api0002.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Hello!

I want to be able to enter a network folder location, by clicking
through
a
directory tree and selecting the folder I want. I currently have
the
"Network Location" column hyperlinked, but typing in a network
location
that's over 7 folders deep is getting old fast.
 
Back
Top