visual basic - code - how to call SubCode

  • Thread starter Thread starter Pekka I.
  • Start date Start date
P

Pekka I.

Question, most likely stupid one, but since I am not too familiar with
visual basic, i need some help;

I have a button in a Form, by pressing button, visual code is called.

Private Sub Set_H1_Click()
Me.Secret_H1 = RandomPassword128H1()
--> here it should also set value for Secret_H2 = RandomPassword128H2
End Sub

and code is setting the value of Secret_H1 from RandomPassword128H1

question; I would like the same code to set also values for Secret_H2,
SecretH3 etc, how can I call those, so i wouldnt need to make button for
setting each value, How ?
 
Hi, is this what you're after?

Private Sub Set_H1_Click()
Me.Secret_H1 = RandomPassword128H1()
Me.Secret_H2 = RandomPassword128H2()
Me.Secret_H3 = RandomPassword128H3()
' etc.
End Sub

Graeme.
 
Back
Top