-
Passing variables between forms
Hi
I have a login form. Once I've confirmed the login I want my main form to
use the login name and password for later database connections. I've tried
declaring the username and password as public variables, but I'm obviously
doing something wrong. My main form recognises the variables (it puts capitals
in the variable names for me) but the values are always empty strings.
-
Re: Passing variables between forms
Craig Jewiss wrote in message <38d0686b@news.devx.com>...
>
>Hi
>
>I have a login form. Once I've confirmed the login I want my main form to
>use the login name and password for later database connections. I've tried
>declaring the username and password as public variables, but I'm obviously
>doing something wrong. My main form recognises the variables (it puts
capitals
>in the variable names for me) but the values are always empty strings.
a) You're probably not using Option Explicit at the top of your forms. You
should.
b) You need to preface the variable with the name of the form; eg, if your
login form is called FLogin, you'd need to use 'FLogin.UserName' and
'FLogin.Password'
--
Colin McGuigan
-
Re: Passing variables between forms
Colin
You were spot on with point b). Thanks.
"Colin McGuigan" <colin@chicor.com> wrote:
>a) You're probably not using Option Explicit at the top of your forms.
You
>should.
>
>b) You need to preface the variable with the name of the form; eg, if your
>login form is called FLogin, you'd need to use 'FLogin.UserName' and
>'FLogin.Password'
>
>--
>Colin McGuigan
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks