Hello guys, i have a problem in my procedure, everything that happens before trying to execute the procedure is read by the program,
but when we call the procedure it doesn't just work in the specific form, can someone help me?
This codes works:
This code doesn´t work:
but when we call the procedure it doesn't just work in the specific form, can someone help me?
This codes works:
VBA Code:
Private Sub bt_calculate_Click()
Call CheckEmpty
End Sub
Private Sub CheckEmpty()
If Not IsNumeric(tb_z_value_.Value) Or tb_z_value_.Text = "" Or Trim(tb_z_value_.Text) = "" Then
MsgBox "'Z Value ' está vazio ou contém números", vbExclamation
ElseIf Not IsNumeric(tb_x_value_.Value) Or tb_x_value_.Text = "" Or Trim(tb_x_value_.Text) = "" Then
MsgBox "'Y Value ' está vazio ou contém números", vbExclamation
ElseIf Not IsNumeric(tb_100.Value) Or tb_100.Text = "" Or Trim(tb_100.Text) = "" Then
MsgBox "'Z = 100 ' está vazio ou contém números", vbExclamation
ElseIf Not IsNumeric(tb_250.Value) Or tb_250.Text = "" Or Trim(tb_250.Text) = "" Then
MsgBox "'Z = 250 ' está vazio ou contém números", vbExclamation
ElseIf Not IsNumeric(tb_400.Value) Or tb_400.Text = "" Or Trim(tb_400.Text) = "" Then
MsgBox "'Z = 400 ' está vazio ou contém números", vbExclamation
ElseIf Not IsNumeric(tb_550.Value) Or tb_550.Text = "" Or Trim(tb_550.Text) = "" Then
MsgBox "'Z = 550 ' está vazio ou contém números", vbExclamation
Else
Z_Axis_Final = tb_z_value_.Value
X_Axis_Final = tb_x_value_.Value
Z_100_Final = tb_100.Value
Z_250_Final = tb_250.Value
Z_400_Final = tb_400.Value
Z_550_Final = tb_550.Value
lb_result.Caption = Z_Axis_Final * 1 - Y_Axis_Final * 1
tb_z_value_.Enabled = False
tb_x_value_.Enabled = False
bt_calculate.Enabled = False
tb_100.Enabled = False
tb_250.Enabled = False
tb_400.Enabled = False
tb_550.Enabled = False
bt_next.Enabled = True
//Call Procedure doesn´t work
Call ShowTextBox
End If
End Sub
This code doesn´t work:
Code:
Private Sub ShowTextBox()
If Z_Axis_Final < 0 And X_Axis_Final < 0 Then
If Z_Axis_Final * 1 - X_Axis_Final * 1 <= 30 And Z_Axis_Final * 1 - X_Axis_Final * 1 >= -30 Then
txt_a.Visible = True
lb_aditional.Visible = True
bt_ok.Visible = True
ElseIf Z_Axis_Final * 1 - X_Axis_Final * 1 > 30 Or Z_Axis_Final * 1 - X_Axis_Final * 1 < -30 Then
End If
ElseIf Z_Axis_Final > 0 And X_Axis_Final < 0 Then
If Z_Axis_Final - X_Axis_Final * 1 <= 30 And Z_Axis_Final - X_Axis_Final * 1 >= -30 Then
txt_a.Visible = True
lb_aditional.Visible = True
bt_ok.Visible = True
ElseIf Z_Axis_Final - X_Axis_Final * 1 > 30 Or Z_Axis_Final - X_Axis_Final * 1 < -30 Then
End If
ElseIf Z_Axis_Final > 0 And X_Axis_Final > 0 Then
If Z_Axis_Final - X_Axis_Final >= -30 And Z_Axis_Final - X_Axis_Final <= 30 Then
txt_a.Visible = True
lb_aditional.Visible = True
bt_ok.Visible = True
ElseIf Z_Axis_Final - X_Axis_Final > 30 Or Z_Axis_Final - X_Axis_Final < -30 Then
End If
ElseIf Z_Axis_Final < 0 And X_Axis_Final > 0 Then
If Z_Axis_Final * 1 - X_Axis_Final <= 30 And Z_Axis_Final * 1 - X_Axis_Final >= -30 Then
txt_a.Visible = True
lb_aditional.Visible = True
bt_ok.Visible = True
ElseIf Z_Axis_Final * 1 - X_Axis_Final > 30 And Z_Axis_Final * 1 - X_Axis_Final < -30 Then
End If
End If
End Sub