Passing variable values between forms
-
This may be a dumb question: I have the variable Port of type integer declared in a module like this: Dim Port as Integer (in general declarations) I then have it declared in each of my forms like this: Dim Port as Integer (in general declarations) How do I pass the value of Port in my main form (frmMain) to another form called from frmMain? David.
-
This may be a dumb question: I have the variable Port of type integer declared in a module like this: Dim Port as Integer (in general declarations) I then have it declared in each of my forms like this: Dim Port as Integer (in general declarations) How do I pass the value of Port in my main form (frmMain) to another form called from frmMain? David.
First of all, you have to change the declaration of Port from Private (Dim) to Public. Then you can just reference the variable using the form name. Ex: form1.Port = frmMain.Port. Hope this helps Jason Gerard MCSD, MCSE Technology Point International, Inc.
-
This may be a dumb question: I have the variable Port of type integer declared in a module like this: Dim Port as Integer (in general declarations) I then have it declared in each of my forms like this: Dim Port as Integer (in general declarations) How do I pass the value of Port in my main form (frmMain) to another form called from frmMain? David.