Question button created to copy and paste a field

Noreago

Registered User.
Local time
Yesterday, 16:44
Joined
Dec 18, 2008
Messages
11
I need help making a button work to copy multiple fields and pasting them in blank fields.

I have created a contact sheet with fields for billing... address, city, postal code, and country. I have identical fields for shipping...address2, city2, postal code2, and country2. What I have done is setup a button between them. What I want the button to do is once clicked it will copy the first address fields and place them in the second address fields.
 

Attachments

Last edited:
You could put something like;
Code:
Me.Address2 = ME.Address1.value
etc.

in the on click event of your button.
 
could you give me more details. I am really new to access. I tried doing what you gave me there in the macro, but it gives me errors
 
Have a look at the attached DB. It's Access 2003 as I don't have 2007 at work. However the coding and principal will be the same. Check the code behind the On Click event of the button.
 

Attachments

i tried the copy button on your test page and it also didn't work
 
i tried the copy button on your test page and it also didn't work
What didn't work? What code did you use, where did you put it? What are the names of your objects? Can you upload a screenshot?
 
sorry that did worrk... there was a security function that was turned off..... i will try that code out on my sheet now
 
i am having errors with the code that was supplied. I have checked it the best i can and don't understand why it comes up with errors.

I also removed the part with the error and tried it. It would only copy over the address and nothing else
 

Attachments

  • code.jpg
    code.jpg
    45.5 KB · Views: 118
  • form.jpg
    form.jpg
    69.2 KB · Views: 129
  • Errormess.jpg
    Errormess.jpg
    52.8 KB · Views: 121
that error is telling you that you don't have a control named PostalCode (check its name and see if it is exactly that name)
 
You will need to change the names in my code to match the names you have used in your DB.
 
i already did that part... you can see that with the images i supplied
 
i already did that part... you can see that with the images i supplied

It looks like you have a field named PostalCode, but the control is not likely named that. Change the control name to PostalCode and it should take care of that.
 
Thanks for the help... it seems to be working. I will most likely be back with more questions
 

Users who are viewing this thread

Back
Top Bottom