Hi,
I'm having a little problem with an if formula in my userforms. What I'm trying to do is, if a user leaves a combo box empty, prompt that there has been no selection made. But if a selection has been made for each of the 3 comboboxes, then the next button will allow the user to jump to the next form,
The code i have so far ...
It's pretty obvious from the above code that it will simply move onto the next form regardless if the combox is empty or not. Can anyone see a solution here??
Thanks in advance
I'm having a little problem with an if formula in my userforms. What I'm trying to do is, if a user leaves a combo box empty, prompt that there has been no selection made. But if a selection has been made for each of the 3 comboboxes, then the next button will allow the user to jump to the next form,
The code i have so far ...
Code:
Private Sub NextForm_Click()
If EmployeeNameBox = "" Then
MsgBox ("You have not selected an employee name")
End If
If DTPicker1.Value = "" Then
MsgBox ("You have not selected an date")
End If
If HoursDepositBox = "" Then
MsgBox ("You have not selected any hours")
End If
EnterHours.Hide
ConfirmDataForm.Show
End Sub
It's pretty obvious from the above code that it will simply move onto the next form regardless if the combox is empty or not. Can anyone see a solution here??
Thanks in advance