How can I copy field entry to next field

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.
 
M

Marshall Barton

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
 
R

Rick B

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
 
G

Guest

-----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
 

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