[RESOLVED] textbox must have value
How to make the textbox is not null ?I want the user must put any value in the textbox. If no value found,it will pop up the messagebox.I got the error message,type missmatch will saving the editing value in the textbox. This is because the user edit the value in the textbox to become null value. The field name is the number data type
Code:
If Len(Text19.Text) = 0 Then
MsgBox "Sila masukkan luas lot dalam ha", vbInformation, "Luas Lot"
Text19.SetFocus
Exit Sub
End If
.Fields("LUAS (Ha)").Value = Text19.Text
Re: textbox must have value
If you don't want to allow spaces only then you must use Trim function:
Code:
If Len(Trim(Text19.Text)) = 0 Then
MsgBox "..."
'...
End If
'or simply Trim only
If Trim(Text19.Text) = "" Then
MsgBox "..."
'...
End If