hawaiian1975
Programmer
Ok, there are several sections for this problem. First I am using a module for my global variables because I need the data stored on one form to integrate into another form.
This is what I have for my global variables:
Option Explicit
Public wheel1 As String, wheel2 As String, wheel3 As String, wheel4 As String
Public wheel5 As String, wheel6 As String, wheel7 As String, wheel8 As String
Second part is that on my Data Entry Form I added a clear menu click to clear up the data in the text boxes and the data stored in the variables: Here is that code:
Private Sub mnuDataClear_Click()
wheel1 = ""
wheel2 = ""
wheel3 = ""
wheel4 = ""
wheel5 = ""
wheel6 = ""
wheel7 = ""
wheel8 = ""
Dim intCount As Integer
For intCount = 0 To 7
txtWheel(intCount).Text = ""
Next intCount
End Sub
Also here is the code when I change to the next form:
Private Sub mnuDataNextForm_Click()
wheel1 = txtWheel(0).Text
wheel2 = txtWheel(1).Text
wheel3 = txtWheel(2).Text
wheel4 = txtWheel(3).Text
wheel5 = txtWheel(4).Text
wheel6 = txtWheel(5).Text
wheel7 = txtWheel(6).Text
wheel8 = txtWheel(7).Text
'hide and show the forms
frmCompute.Show
frmDataEntry.Hide
End Sub
Okay, once I get to the Compute Form I have the data from the Data Entry Form added and shown in some text boxes.
Private Sub Form_Load()
'load data from Data Entry Form
txtAxle(0).Text = Val(wheel1) + Val(wheel2)
txtAxle(1).Text = Val(wheel3) + Val(wheel4)
txtAxle(2).Text = Val(wheel5) + Val(wheel6)
txtAxle(3).Text = Val(wheel7) + Val(wheel8)
End Sub
Ok, on this form I also have a clear button. When I click it and go back to the Data Entry form to enter new data, it does not show up on the Compute Form when I revert back.
Private Sub cmdClear_Click()
Dim intCount As Integer
For intCount = 0 To 3
txtAxle(intCount).Text = ""
Next intCount
wheel1 = ""
wheel2 = ""
wheel3 = ""
wheel4 = ""
wheel5 = ""
wheel6 = ""
wheel7 = ""
wheel8 = ""
End Sub
This is what I have for my global variables:
Option Explicit
Public wheel1 As String, wheel2 As String, wheel3 As String, wheel4 As String
Public wheel5 As String, wheel6 As String, wheel7 As String, wheel8 As String
Second part is that on my Data Entry Form I added a clear menu click to clear up the data in the text boxes and the data stored in the variables: Here is that code:
Private Sub mnuDataClear_Click()
wheel1 = ""
wheel2 = ""
wheel3 = ""
wheel4 = ""
wheel5 = ""
wheel6 = ""
wheel7 = ""
wheel8 = ""
Dim intCount As Integer
For intCount = 0 To 7
txtWheel(intCount).Text = ""
Next intCount
End Sub
Also here is the code when I change to the next form:
Private Sub mnuDataNextForm_Click()
wheel1 = txtWheel(0).Text
wheel2 = txtWheel(1).Text
wheel3 = txtWheel(2).Text
wheel4 = txtWheel(3).Text
wheel5 = txtWheel(4).Text
wheel6 = txtWheel(5).Text
wheel7 = txtWheel(6).Text
wheel8 = txtWheel(7).Text
'hide and show the forms
frmCompute.Show
frmDataEntry.Hide
End Sub
Okay, once I get to the Compute Form I have the data from the Data Entry Form added and shown in some text boxes.
Private Sub Form_Load()
'load data from Data Entry Form
txtAxle(0).Text = Val(wheel1) + Val(wheel2)
txtAxle(1).Text = Val(wheel3) + Val(wheel4)
txtAxle(2).Text = Val(wheel5) + Val(wheel6)
txtAxle(3).Text = Val(wheel7) + Val(wheel8)
End Sub
Ok, on this form I also have a clear button. When I click it and go back to the Data Entry form to enter new data, it does not show up on the Compute Form when I revert back.
Private Sub cmdClear_Click()
Dim intCount As Integer
For intCount = 0 To 3
txtAxle(intCount).Text = ""
Next intCount
wheel1 = ""
wheel2 = ""
wheel3 = ""
wheel4 = ""
wheel5 = ""
wheel6 = ""
wheel7 = ""
wheel8 = ""
End Sub