P
Pete Davis
I have an app for a real estate company. There are 3 main forms:
ForSale
ForRent
PropertyDetails.
Both the ForSale and ForRent properties are each associated with a
PropertyDetails record, so the PropertyDetails form is a subform for both
the ForSale and ForRent form.
My client wants a button that will create a copy of all the data for the
current record, minus the keys.
So, let's assume we've got the ForSale form up. The first thing I need to do
is create a new copy of the property details record. Then I need to create a
copy of the ForSale record and attach the new PropertyDetailsID to it.
I've created an append query for both the PropertyDetails record and the
ForSale record.
The general form is:
Insert into PropertyDetails(field1, field2, field3, ...)
Select field1, field2, field3, ...
From PropertyDetails
Question #1: I'd like to create a where condition and be able to pass the
unique ID for the PropertyDetails record I wish to copy. How do I do that?
Question #2: How do I get the ID of the newly inserted record?
Question #3: In the ForSale append query, I need to pass the
PropertyDetailsID that I obtained in Question #2, into the insert into. How
would I do this if the method is different from #1?
Thanks.
Pete
ForSale
ForRent
PropertyDetails.
Both the ForSale and ForRent properties are each associated with a
PropertyDetails record, so the PropertyDetails form is a subform for both
the ForSale and ForRent form.
My client wants a button that will create a copy of all the data for the
current record, minus the keys.
So, let's assume we've got the ForSale form up. The first thing I need to do
is create a new copy of the property details record. Then I need to create a
copy of the ForSale record and attach the new PropertyDetailsID to it.
I've created an append query for both the PropertyDetails record and the
ForSale record.
The general form is:
Insert into PropertyDetails(field1, field2, field3, ...)
Select field1, field2, field3, ...
From PropertyDetails
Question #1: I'd like to create a where condition and be able to pass the
unique ID for the PropertyDetails record I wish to copy. How do I do that?
Question #2: How do I get the ID of the newly inserted record?
Question #3: In the ForSale append query, I need to pass the
PropertyDetailsID that I obtained in Question #2, into the insert into. How
would I do this if the method is different from #1?
Thanks.
Pete