Dear all,
I am working on an Access file, and inside there, I have a lot of forms, but I need to somehow pass a variable from one form to the other, can anyone show me how to do that?
thank you very much
PlayKid
Printable View
Dear all,
I am working on an Access file, and inside there, I have a lot of forms, but I need to somehow pass a variable from one form to the other, can anyone show me how to do that?
thank you very much
PlayKid
any variables that I want to be available to ALL forms, I usually put in a module
VB Code:
Public strData As String
Now, I can do the following in frmMain
VB Code:
Private Sub cmdInput_Click() strData = "w00t" frmTwo.Show End Sub
and for frmTwo's Form_Load:
Now, frmTwo's Caption would be equal to a variable that you set in frmMain.VB Code:
Private Sub Form_Load() Me.Caption = strData End Sub
Can I say something like this?
VB Code:
TextBox12 = [Form 1].[TextBox11]
Quote:
Originally Posted by PlayKid
If TextBox12 is a global variable like LostAngel posted, then yes.