I am opening up a mainform “frmMAIN” that will have command buttons to open a popup form “frmSECOND” and “frmTHIRD” and several others. I want to declare a public variable “strA1” that can be used and passed between the various popup forms. Where do I declare this variable? At this point I am only familiar with using the event handling sections of the vb code (such as in the command buttons and “on click” or “on open” etc of the form objects”) so if the public variables are declared elsewhere I would need to be pointed in the right direction. I tried putting it in the declaration section of the “frmMAIN” under
__________________
Option Compare Database
Public strA1
___________________
And then tried to define “strA1” in the “on open” event:
Private Sub Form_Open(Cancel As Integer)
Dim strA1 As String
strA1 = "City"
Me.Text20.VALUE = strA1
End Sub
but it only worked in the “frmMAIN” and did not pass to the popup forms “frmSECOND”.
So where do I put it and is this the right syntax?
Thanks
__________________
Option Compare Database
Public strA1
___________________
And then tried to define “strA1” in the “on open” event:
Private Sub Form_Open(Cancel As Integer)
Dim strA1 As String
strA1 = "City"
Me.Text20.VALUE = strA1
End Sub
but it only worked in the “frmMAIN” and did not pass to the popup forms “frmSECOND”.
So where do I put it and is this the right syntax?
Thanks