I have a Data Input form and have put the following code in but if I miss out a field, it brings up my dialogue box saying you have missed this field but still populates the backing data sheet. Can anyone help me with the correct coding. Thanks in advance
'Transfer the name
Cells(NextRow, 1) = TraineeName.Text
'clear controls for next entry
TraineeName.Text = ""
OptionUnknown = True
TraineeName.SetFocus
'make sure a name is entered
If TraineeName.Text = "" Then
MsgBox "Please enter name"
Exit Sub
End If
'Transfer the team
Cells(NextRow, 2) = Team.Text
'clear controls for next entry
Team.Text = ""
OptionUnknown = True
Team.SetFocus
'make sure a team is entered
If Team.Text = "" Then
MsgBox "Please enter team"
Exit Sub
End If
Bookmarks