Automatically copy and paste a field with a button

duklaprague

New member
Local time
Today, 01:45
Joined
May 30, 2007
Messages
4
Hope someone can help with this.

I have a main form that lists records of tourist attractions contained in our own graphic database. Within the form there is also a subform that lists some fields from another table of further info, including an alternative name form.

In most cases the name forms match, but sometimes they differ - hence the need for both.

So basically, in my subform I'm trying to add a button that will automatically copy the name from the main form, and paste it into the name field in the subform.

I got close with a little macro :

1. Goto Control > Name
2. Run command > Copy
3. Goto Control > Any field in the main form
4. Run command > Paste

Which works great - it will happily jump out of the subform to the specified field in the main form, but isn't so happy to jump back into the subform.

Hope this makes sense, and there's a solution.
 
Last edited:
you have not created an action in your macro that will set the focus to a control on your sub form as the macro ends after the paste.
 
you have not created an action in your macro that will set the focus to a control on your sub form as the macro ends after the paste.

What do I need to do there? Isn't paste the last thing I want to do?

I just need to either change step 3, or add in a step before step 3.

I tried goto control : [form_name]![field_name], but just got an error saying the form wasn't open.
 

Users who are viewing this thread

Back
Top Bottom