Copy current record in subform to new table

  • Thread starter Thread starter Emilio
  • Start date Start date
E

Emilio

Hi, I am a newbie with aproblem.

I need to copy current record in subform (based on
table "OrderDetails") so I can paste in new table, so
users can make changes (by opening in new form) without
affecting original record.

I tried CopyObject and works OK except this table is way
too large.

Is there a better way to acomplish this?

Thanks in advance for any help,
Emilio
 
Emilio,

You can use an Append Query to do this. Make a query in design view
based on the OrderDetails table, and in the criteria of the primary Key
field (which I will assume is called OrderDetailID), refer to the
current record in the subform, for example...
[Forms]![Orders]![OrderDetails]![OrderDetailID]
Make it an Append Query (select Append from the Query menu), nominate
the table you want to copy the record to, enter the names of the
required fields into the Append To row of the query design grid. Run
the query (click the button on the toolbar with the red ! icon).
 
Thank you very much Steve, I have been putting this off
for a long time because I always thought that it was more
complicated.

One last thing If I may, is there a way not to see the
"You are about to append X records.....(or something
like it)"
I want to make it as transparent as possible for the
users.

Thanks again,
Emilio


-----Original Message-----
Emilio,

You can use an Append Query to do this. Make a query in design view
based on the OrderDetails table, and in the criteria of the primary Key
field (which I will assume is called OrderDetailID), refer to the
current record in the subform, for example...
[Forms]![Orders]![OrderDetails]![OrderDetailID]
Make it an Append Query (select Append from the Query menu), nominate
the table you want to copy the record to, enter the names of the
required fields into the Append To row of the query design grid. Run
the query (click the button on the toolbar with the red ! icon).

--
Steve Schapel, Microsoft Access MVP

Hi, I am a newbie with aproblem.

I need to copy current record in subform (based on
table "OrderDetails") so I can paste in new table, so
users can make changes (by opening in new form) without
affecting original record.

I tried CopyObject and works OK except this table is way
too large.

Is there a better way to acomplish this?

Thanks in advance for any help,
Emilio
.
 
Emilio,

You can use a macro or vba procedure, for example on the Click event of
a command button, to run the Append Query. If a macro, you can use an
OpenQuery macro action to run the query, and if you put a SetWarnings/No
action before the OpneQuery, it will suppress the display of the action
query confirmation messages. In a vba procedure, you can do this...
CurrentDb.Execute "NameOfYourQuery", dbFailOnError
.... and this will run the query without the confirmations prompts.

--
Steve Schapel, Microsoft Access MVP
Thank you very much Steve, I have been putting this off
for a long time because I always thought that it was more
complicated.

One last thing If I may, is there a way not to see the
"You are about to append X records.....(or something
like it)"
I want to make it as transparent as possible for the
users.

Thanks again,
Emilio



-----Original Message-----
Emilio,

You can use an Append Query to do this. Make a query in

design view
based on the OrderDetails table, and in the criteria of

the primary Key
field (which I will assume is called OrderDetailID),

refer to the
current record in the subform, for example...
[Forms]![Orders]![OrderDetails]![OrderDetailID]
Make it an Append Query (select Append from the Query

menu), nominate
the table you want to copy the record to, enter the

names of the
required fields into the Append To row of the query

design grid. Run
the query (click the button on the toolbar with the

red ! icon).
--
Steve Schapel, Microsoft Access MVP


without

way


.
 
Thanks again!

Emilio


-----Original Message-----
Emilio,

You can use a macro or vba procedure, for example on the Click event of
a command button, to run the Append Query. If a macro, you can use an
OpenQuery macro action to run the query, and if you put a SetWarnings/No
action before the OpneQuery, it will suppress the display of the action
query confirmation messages. In a vba procedure, you can do this...
CurrentDb.Execute "NameOfYourQuery", dbFailOnError
.... and this will run the query without the confirmations prompts.

--
Steve Schapel, Microsoft Access MVP
Thank you very much Steve, I have been putting this off
for a long time because I always thought that it was more
complicated.

One last thing If I may, is there a way not to see the
"You are about to append X records.....(or something
like it)"
I want to make it as transparent as possible for the
users.

Thanks again,
Emilio



-----Original Message-----
Emilio,

You can use an Append Query to do this. Make a query
in

design view
based on the OrderDetails table, and in the criteria
of

the primary Key
field (which I will assume is called OrderDetailID),

refer to the
current record in the subform, for example...
[Forms]![Orders]![OrderDetails]![OrderDetailID]
Make it an Append Query (select Append from the Query

menu), nominate
the table you want to copy the record to, enter the

names of the
required fields into the Append To row of the query

design grid. Run
the query (click the button on the toolbar with the

red ! icon).
--
Steve Schapel, Microsoft Access MVP


Emilio wrote:

Hi, I am a newbie with aproblem.

I need to copy current record in subform (based on
table "OrderDetails") so I can paste in new table, so
users can make changes (by opening in new form)
without

affecting original record.

I tried CopyObject and works OK except this table is
way

too large.

Is there a better way to acomplish this?

Thanks in advance for any help,
Emilio


.
.
 
Back
Top