Simple Question about variables (Public)
Posted on 2003-11-07
I am trying to allow my two forms to read from each toerh and in future from other forms,
Everyone says to place
Public UName As String
But this doesnt allow my other form to read the variable value
There may be something wrong within the rest of my code so I will place it here,
This is the sign up form which will eventually send the information to my database when I have enough knowledge to do that (not a request for help)
Private Sub cmdSubmitDetails_Click()
Dim msgbox_1Submit 'This is the button they click on after they have inputed their details
msgbox_1Submit = MsgBox("Is this information correct?", 4, "Validation")
Select Case msgbox_1Submit
MsgBox "Please make the changes and then Select 'Submit'."
Public UName As String 'These are in the
Public UAge As Integer 'General declerations
Public UCountry As String 'Like i was told to do
UName = txtEnterName.Text
UAge = txtEnterAge.Text
UCountry = txtEnterCountry.Text
MsgBox "Successfully Submitted"
MsgBox "Welcome " & UName & " who is " & UAge & " and lives in " & UCountry
frmMain.Visible = True 'Loads next form
frmSubmitNew.Visible = False 'Gets rid of old form
The next form only has the one line for the moment.
Private Sub Form_Load()
lblWelcome.Caption = "Hello " & UName & "."
Help would be very much appreciated,