Hi,
I am having two text fields in my form frist and last that represent names. I wrote a VBA code so that if some one leave those fileds null and saves the form it should show an error message. But for some reason its still taking null values. that is the if statement is not working. Here is the sample code
Dim addfunc As String
If (first.Value = Null) or (last.value= Null) Then
MsgBox "You have left one of the fields blank, please make sure that all fields are filled in before continuing"
Else
addfunc = first.Value & " " & last.Value
empname.Value = addfunc
DoCmd.GoToRecord , , acNewRec
Can someone please tell me what's the problem in this code
Thanks
I am having two text fields in my form frist and last that represent names. I wrote a VBA code so that if some one leave those fileds null and saves the form it should show an error message. But for some reason its still taking null values. that is the if statement is not working. Here is the sample code
Dim addfunc As String
If (first.Value = Null) or (last.value= Null) Then
MsgBox "You have left one of the fields blank, please make sure that all fields are filled in before continuing"
Else
addfunc = first.Value & " " & last.Value
empname.Value = addfunc
DoCmd.GoToRecord , , acNewRec
Can someone please tell me what's the problem in this code
Thanks