Okay this is getting confusing, with saving an what not. So ive added my updated project. I have tried many methods, but i still cannot fix my problem. When i click the check button, it says incorrect no matter what the answer is.
Also here is the code:
Form 1:
Form 2:Code:Private Sub Form_Load() Dim TB1 As Integer: Dim TB2 As Integer Text1.Caption = TB1 + TB2 Randomize Timer TB1 = Rnd(0 + 1) * 100 Text1.Caption = TB1 TB2 = Rnd(0 + 1) * 100 Text2.Caption = TB2 End Sub Private Sub Command1_Click() Dim TB1 As Integer: Dim TB2 As Integer Randomize Timer TB1 = Rnd(0 + 1) * 100 Text1.Caption = TB1 TB2 = Rnd(0 + 1) * 100 Text2.Caption = TB2 End Sub Private Sub Command2_Click() Form2.Show End Sub
Code:Private Sub Form_Load() Dim form1 As New form1 lblOutput.Caption = IIf(form1.Text1 + form1.Text2 = form1.Text2, "Correct", "Incorrect") End Sub Private Sub Command1_Click() Form2.Hide End Sub




Reply With Quote