473,397 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Problem with path visual basic

Hi,

i'm new with visual basic.
My problem is the following :

According to the code i have attached,
i use two buttons,
when i press the BUTTON1, opens Browse Folder, i select the drive where i store files and i want to use the path that i have just selected. For this reason i transfer the path to another variable named: PATH

When i use the variable PATH to another function (BUTTON2) it seems like the variable KM has no value. Error message : "Path not found"

How can i use the variable PATH to the other function ?

Hope somebody can help me,
Thank you
-------------------------------------------------------------------------------------
Private Sub BUTTON1_Click()

Dim KM As String
Dim PATH As String

KM = BrowseForFolder(hwnd, "Please select a folder.")

If KM = "" Then
Call MsgBox("The Cancel button was pressed.", vbExclamation)
Else
Call MsgBox("The folder " & KM & " was selected.", vbExclamation)
PATH = KM

End If

End Sub
Feb 4 '10 #1
2 1311
vb5prgrmr
305 Expert 100+
Declare the path variable in the general declarations section of the form/module because presently, its scope is only the sub in which it was declared in...



Good Luck
Feb 4 '10 #2
Thank you

for the quick response, i'll try your suggestion !!
You are right !
Feb 4 '10 #3

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

Similar topics

7
by: longtungd1 | last post by:
I'm currently taking a Visual C++ course. I have C++ version 6.0 on my machine. I set up a basic program per course instructions to simply create a window with default toolbar, etc., using App...
7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
0
by: Les P | last post by:
Hi, Since '95 I have been a contractor develoing applications using Borland Delphi (Object Pascal) creating win32 C/S stuff. Having recently completed amy last contract I decided to try my hand at...
4
by: David Scemama | last post by:
Hi, I'm trying to read a database file written from a turbo Pascal program. I've set a structure to map the records in the file, but I have problem reading the file when I use VBFixedArray in...
2
by: Kasumo Morris | last post by:
Hello All, I would like to know which registry key holds visual basic install path. On my development workstation my visual basic is installed on the d drive; on our test machine, the e drive. ...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
4
by: sqlguy | last post by:
Why do we have to contact MS for a problem that has been with this compiler from at least the beta of VS 20005. I am so sick and tired of the 30 - 40 clicks it takes to dismiss VS when there is a...
5
by: Tym | last post by:
Not sure this is the right group - but here goes. I kinda expect Dick Grier to jump in on this one ;-) I've got a windows app in VB.Net 2005 which sends and receives text messages via a USM...
1
by: crusson | last post by:
(edited to add): this is in Visual Basic .net I am at a complete loss... I've been building a program on my machine, running it out of the developer with the f5 key and builidng it and running...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.