if null

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
 
D

Duane Hookom

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top