kevin1478
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
correction...
Assuming this code is running from the same form as the one with these two text boxes on it.
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
Me![Invoice Address] = Me![Business Address]
Cheers, Andrew
ASKER
Thank you. All working.
ASKER
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.