Link to home
Start Free TrialLog in
Avatar of kevin1478
kevin1478Flag for United Kingdom of Great Britain and Northern Ireland

asked on

MS Access 2003 - VBA code to copy 1 field to another in the same form

Dear Experts
I have a form named address.  The form contains fields named:
Business address
Invoice Address

I want to add a button to the form that will copy the details in business address to invoice address.

The actual form is slightly more complicated but if I can understand the above then I will be able to adapt and apply it.

Can someone please help with the VBA?

Thank you.
SOLUTION
Avatar of TextReport
TextReport
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kevin1478

ASKER

Thank you.

Ive implemented the code as suggested and I get the error:

The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Office Access was communication with the OLE server or ActiveX Control.

To test the error I added a button using the wizard to close the form and I got the same error.

Any ideas please.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
correction...

Assuming this code is running from the same form as the one with these two text boxes on it.
You must ensure you get the names of the controls correct. Looking at what you said in the first posting it could be

Me![Invoice Address] = Me![Business Address]

Cheers, Andrew
Thank you. All working.