У меня есть две формы. Первая форма имеет текстовые поля, которые должен заполнить пользователь, прежде чем перейти к следующей форме для заполнения. Ниже мой код. Код дает мне ошибку. Когда я нажимаю командную кнопку, чтобы закрыть форму 1 и начать форму 2.
Если поля в пользовательской форме 1 не заполнены, пользователь не должен переходить к форме 2.
Private Sub NexFinInfo_Click()
If CLN.Text = "" Then
MsgBox ("Company Legal Name is a mandatory field!")
Else
Range("A2").Value = CLN.Text
End If
If BRL.Text = "" Then
MsgBox ("Business Registration/ License is a mandatory field!")
Else
Range("B2").Value = BRL.Text
End If
If COA.Text = "" Then
MsgBox ("Company Address is a mandatory field!")
Else
Range("C2").Value = COA.Text
End If
Range("D2").Value = PON.Text
Range("E2").Value = TNR.Text
If BLA.Text = "" Then
MsgBox ("Billing Address is a mandatory field!")
Else
Range("F2").Value = BLA.Text
End If
If Range("A2:C3", "F2").Value = "" And Then
MsgBox ("All the fields marked with * in the form are mandatory")
Else
Unload Me
FININFO.Show
End If
End Sub