Try
If Trim(UserForm1.TextBox1.Value) = "" Then
MsgBox ("You haven't inserted the date!")
Exit Sub
End If
If Trim(UserForm1.ComboBox1.Value)) = "" Then
MsgBox ("You haven't inserted the code of product!")
Exit Sub
End If
The trim should remove the spaces, hence it will be better.
If you want to improve the performance check the length
If len(Trim(UserForm1.TextBox1.Value)) = 0 Then
MsgBox ("You haven't inserted the date!")
Exit Sub
End If
If len(Trim(UserForm1.ComboBox1.Value))) = 0 Then
MsgBox ("You haven't inserted the code of product!")
Exit Sub
End If
Cheers
Shasur
http://www.vbadud.blogspot.com