How can I copy field entry to next field

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

Using Access 2002
How can I copy text entered in one field to another field
in the same table? I have two fields, one called
ClientFormalName and the other is ClientName. When an end
user types in the Client Formal Name, and tabs to the
next field, Client Name, if the ClientName field is null,
I want to copy the text from ClientFormalName into
ClientName. This would eliminate duplicate typing of the
name, but also allow the end user to edit the Client Name
if it is different. I've searched and can only find code
related to records, not fields.
 
Doug said:
Using Access 2002
How can I copy text entered in one field to another field
in the same table? I have two fields, one called
ClientFormalName and the other is ClientName. When an end
user types in the Client Formal Name, and tabs to the
next field, Client Name, if the ClientName field is null,
I want to copy the text from ClientFormalName into
ClientName. This would eliminate duplicate typing of the
name, but also allow the end user to edit the Client Name
if it is different. I've searched and can only find code
related to records, not fields.


Use the ClientFormalName text box's AfterUpdate event:

If IsNull(Me.ClientName) Then
Me.ClientName = Me.ClientFormalName
End If
 
I assume the user is doing this through a form?

You would add code to the field [ClientFormalName]'s AfterUpdate event, put
code like...

If Isnull([ClientName]) then
[ClientName] = [ClientFormalName]
End If


Hope that helps,

Rick B
 
-----Original Message-----
Use the ClientFormalName text box's AfterUpdate event:

If IsNull(Me.ClientName) Then
Me.ClientName = Me.ClientFormalName
End If

That worked great! Thanks much!
--Doug
 
Back
Top