if null

  • Thread starter Thread starter DaveB
  • Start date Start date
D

DaveB

I have a box that is suppose to put the LastName,
FirstName in if it is null, but for some reason it only
works if I put some text in it and then delete it and
then go out of the box. Any suggestions? Below is my VB.

Private Sub CompanyName_AfterUpdate()
'Copy the LastName, FirstName value to the CompanyName
Control
If IsNull(CompanyName) Or Len(CompanyName) = 0 Then
Me!CompanyName = (LastName) & "," & (FirstName)
End If
End Sub
 
Your code requires that CompanyName be "updated". You may need to look at
placing your code in a different event such as lost focus or other.
 
Back
Top