Hi all i want to pass the variable that has been declared in Form 1 to say FormN. Say this is my idea, there are two users anonymous user and authenticated user, who log into the ebook management system and obviously only authenticated user(AU) can edit and manipulate the database. Now i want to pass the variable say Flag , and will assign the flag value as 0 for anonymous user and 1 for AU.
My doubt is in form1(where i’m going to set the flag value). And how to pass this value to say Form3 so that depends upon the Flag i will set enable and disable the add/delete.. buttons for anonymous and Au user respectively. How to do this in VB6?
Note that the add/delete button add and delete the table in the database.
This is what i need:
In form1
Private Sub XXX_Click()
{
`have to initialize the flag depending on user's log-in
}
in form 2, where i have to check the flag function, so that i can disable the buttons (according to user). My doubt is where to place these functions?
You might use this way:
In
Form1you declare a public variable Flag and optionally the Form_Initialize() method:In
Form3you also declare a public variable Flag:then in
Form1somewhere in your code you do this:and then in
Form3Form_Load()you will have the varFlagalready set to proper value.