Hi Guys,
Been struggling with this one for quite a while and could really do with some help. I’m trying to nestle a message box within an IF statement, is that possible? Either I’m missing some End if’s or I’ve just got the whole structure wrong, either way I can’t progress past this point. Can anyone provide some pointers as to where I’m going wrong?
At the moment I have something like this.....
IF *(checks if any fields are empty) Then
MsgBox "Your Form is not ready for submission. Please complete ALL fields before continuing.", vbOKOnly + vbExclamation, "ERROR"
Else
Answer = MsgBox("Please review the information below and ensure that everything is correct. If there are any errors, press No to correct the form." & vbCrLf & _
"Your name:" & TextBox1.Value & vbCrLf & _
"Would you like to submit your form?", vbYesNo)
If Answer = vbYes Then
Sheets("Data").Visible = True
Sheets("Data").Select
i = ActiveSheet.UsedRange.Rows.Count + 1
LastRow = i
Range("A" & i).Value = Date
Etc etc
Unload Me
UserForm2.Show
If Answer = vbNo Then
UserForm1.Show
End If
Been struggling with this one for quite a while and could really do with some help. I’m trying to nestle a message box within an IF statement, is that possible? Either I’m missing some End if’s or I’ve just got the whole structure wrong, either way I can’t progress past this point. Can anyone provide some pointers as to where I’m going wrong?
At the moment I have something like this.....
IF *(checks if any fields are empty) Then
MsgBox "Your Form is not ready for submission. Please complete ALL fields before continuing.", vbOKOnly + vbExclamation, "ERROR"
Else
Answer = MsgBox("Please review the information below and ensure that everything is correct. If there are any errors, press No to correct the form." & vbCrLf & _
"Your name:" & TextBox1.Value & vbCrLf & _
"Would you like to submit your form?", vbYesNo)
If Answer = vbYes Then
Sheets("Data").Visible = True
Sheets("Data").Select
i = ActiveSheet.UsedRange.Rows.Count + 1
LastRow = i
Range("A" & i).Value = Date
Etc etc
Unload Me
UserForm2.Show
If Answer = vbNo Then
UserForm1.Show
End If