How to pass a Variable from Form1 to say FormN in VB6? -


Hello, I want to pass the variable, which is declared in Form 1, FormN. This is my opinion, two users are anonymous users and certified users who enter the eBook management system and can clearly edit and manipulate the Certified User (AU) database. Now I want to pass the variable saying the variable as flag and the anonymous user will have to assign the flag as 0 and 1 for the AU. My suspicion is in Form 1 (where I'm going to set the flag price). And how to pass this value to say form 3, so that depending on the flag , I will enable and disable the AD / Delete button for anonymous and AU user. How to do this in VB6?

Note that the Add / Remove Button add and remove the table in the database.

I need it:

In Form 1

  Personal sub XXX_Click () {Initialize flag based on user's log-ins Will be} in Form 2, check the flag function where I want to, so that I can disable the button (according to the user) I doubt where to put these functions?   

You can use it like this:

You have a public variable flag And alternatively, the Form_Initialize () method can declare:

  public flag as integer sub-initialize () 'here you set your default value, if it is not vedically You can also declare a public variable in the 0 flag = 0 and sub   

flag:

  integer As sub Generic flag- initialize () 'Here you set your default value for this variable if it is not 0 flag = 0 and sub   

then in form1 Anywhere in your code, you do this:

  sub-your_function () '... ... form of FIFF form 3 set F = new form 3F.flag = me.flag F.Show' Or f Show vbModal '... end sub   

and then in form3 form_load () you get the value flag is already set to a fair price.

Comments