Record duplication

P

Pete Davis

I have an Access app that I've built for a small real-estate company. I have
three forms in particular:

1 for properties for sale
1 for properties for rent
and 1 called PropertyDetails that is shared by both of the above forms.

So the for sale and for rent forms each have a property details form
attached with data in common between the two.

What I need to do is find a way that, with a button press, I can create a
new for sale or a new for rent property along with a companion property
details record with all the data but the primary keys copied from one form
to another.

Is there any way to do this automatically or will I need to do it by hand
(a.k.a. copy each field, one at a time, to the new record?)

Pete
 
P

Pete Davis

Phil,

This sounds exactly like what I'm looking for, but being a newbie, I have
no idea how to go about this.

I know how to create a query, but how do I create one as you suggest, that
inserts a new row and that can pull the data from the forms?

Thanks.

Pete

--
http://www.petedavis.net
Phil Jones said:
Pete,

I would suggest that you develop an append query that can add a new record
to your table. When you are building this query, use the builder to set the
value of each field to the cooresponding value on your form, leaving the PK
fields blank, as (assuming they are autonumbering) they will populate by
themselves. On the button, place the following code:

docmd.OpenQuery "the name of your append query"

When you click the button the query will execute. It will look at the form
and insert the current values of each field to a new record.

Regards,

Phil
 
P

Phil Jones

Pete,

I would suggest that you develop an append query that can add a new record
to your table. When you are building this query, use the builder to set the
value of each field to the cooresponding value on your form, leaving the PK
fields blank, as (assuming they are autonumbering) they will populate by
themselves. On the button, place the following code:

docmd.OpenQuery "the name of your append query"

When you click the button the query will execute. It will look at the form
and insert the current values of each field to a new record.

Regards,

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top