Automatically fill in a field

  • Thread starter Thread starter DaveB
  • Start date Start date
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.
 
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
 
Back
Top