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

Getting a File Path

P: 14
Hi,

I've got a form (in Vb Express 2008) which has a TextBox and a Button saying Browse

I've managed to get the form to open the Open Dialogue when I press the Browse button, and I can use that to select the .mdb file I want, but how can I get the file path (ie. E:/Comp/Database/records.mdb) into the text box?

cheers if you can help
Jun 22 '08 #1
Share this Question
Share on Google+
5 Replies


P: 11
Basically the following, however this does not account for erronus data etc..

Expand|Select|Wrap|Line Numbers
  1.     Private Sub Browse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Browse.Click
  2.         If OpenFileDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
  3.             FilePath.Text = OpenFileDialog1.FileName.ToString()
  4.         End If
  5.     End Sub
Above code is assuming;
  • the button to 'browse' is called Browse
  • the file dialog is called OpenFileDialog1
  • the FilePath text box is where the path is to be placed

Hope this helps
Lee
Jun 27 '08 #2

P: 14
that simple? suppose its all about knowing the right commands, cheers i'll give that a go
Jun 30 '08 #3

P: 2
Hello, will this code work for visual basic in excel?

Saludos
Jun 30 '08 #4

P: 14
great, that worked, cheers, now the tedious bit, copying and moving data, thanks again
Jul 1 '08 #5

daniel aristidou
100+
P: 491
great, that worked, cheers, now the tedious bit, copying and moving data, thanks again
Hi baladin.....the best way to deal with moving and copying data is by using snippets. Right click where you want to place the code and select add snippet, then locate your way around the menu provided until you find the code you need
Jul 1 '08 #6

Post your reply

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