Automatically fill in a field

D

DaveB

On my form I have a field that says "name". I also have
fields for "firstname", and one for "lastname". If I
don't fill in a business name in the "name" field I want
it to fill in the "lastname","firstname" after I type
them in their fields. Could you please tell me how do I
do this, and where do I do it at? Remember, I'm a
beginner, so please keep it simple.
 
W

Wayne Morgan

First, change the name field to BusinessName or whatever else you would
like. Name is a reserved word and can cause you problems.

In the AfterUpdate event of the LastName and FirstName controls you would
check the value in the BusinessName control and if it is blank, fill in as
you requested.

Example:
If Nz(Me.txtBusinessName,"") = "" Then
Me.txtBusinessName = Me.txtLastName & ", " & Me.txtFirstName
End If
 

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