i want my program to pop up a form that asks information like you name and such. then i want this information to be placed in other parts of code in my program. i dont know much about how to use variables, so can anyone help me out?
Hello !
First of all you must save you info you can do it with variables, with property of controls
if u wnat to use variables u must declare them as Public
for example
Public x as integer
and after this declaration u can use variable x in all parts of program
or u can use property of control. I guess user fill some text and other info into the controls and then u hide a form but u dont unload it and thus u can use form and all control on it
its easy
Sage
I think the best way to do this is to use a user defined type variable for your user details, then set a variable with global scope of type "user" and then you can access any of the user details from anywhere in your project.
I would do this by:
1) In a module put the following code:
Option Explicit
Public Type udtUser
Name As String
Age As Integer
Gender As String
' change the details of the user accordingly
End Type
Global uUser As udtUser
2) Set up your "user details" form to set the properties of your 'user' variable -
eg create a form with tree text boxes - Text1(0), Text1(1) and Text1(2) - and paste this code into the module:
Option Explicit
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.