Appending more than one recored

S

Simon

I have a datasheet form that is based on a query. On this form is
shows some peoples names and information I then have a button at the
bottom of the form that runs an Append query.

It runs the append query but it does not append all the recored on the
datasheet. It only appends the first recored. I then have to click the
button again to append the next recored.


How can i set it up so it append all the recoded that are displayed on
the forms which is based on the qery?



Thanks
 
S

storrboy

I have a datasheet form that is based on a query. On this form is
shows some peoples names and information I then have a button at the
bottom of the form that runs an Append query.

It runs the append query but it does not append all the recored on the
datasheet. It only appends the first recored. I then have to click the
button again to append the next recored.

How can i set it up so it append all the recoded that are displayed on
the forms which is based on the qery?

Thanks


What is the query you are using?
I would think that Insert * Into.... would work.
 
S

Simon

What is the query you are using?
I would think that Insert * Into.... would work.

The query i have is

INSERT INTO tblCustomers ( CustomerNumber, Title, FirstName, LastName,
PhoneNumber, MobileNumber, InvoiceAddressHouseName, InvoiceAddress1,
InvoiceAddress2, InvoiceAddress4, InvoiceAddress3, InvoicePostCode,
Tub, Question, Contacted, ContactedWhen, BroucherRequest,
BroucherSent, EmailAddress, HowDidYOuHearOfUs, InvoiceCountry,
[Date] )
SELECT CLng(Nz(DMax("CustomerNumber","tblCustomers"),0))+1 AS Expr1,
tblBrochure.Title, tblBrochure.FirstName, tblBrochure.Surname,
tblBrochure.TelphoneNumber, tblBrochure.MobileNumber,
tblBrochure.HouseNameNumber, tblBrochure.AddressLine1,
tblBrochure.AddressLine2, tblBrochure.AddressLine4,
tblBrochure.AddressLine3, tblBrochure.PostCode, tblBrochure.Tub,
tblBrochure.Question, tblBrochure.Contacted,
tblBrochure.ContactedWhen, tblBrochure.BrochureRequest,
tblBrochure.BrochureSent, tblBrochure.EmailAddress,
tblBrochure.HowDidYOuHearOfUs, tblBrochure.Country, tblBrochure.Date
FROM tblBrochure
WHERE (((tblBrochure.BrochureRequest)=-1) AND
((tblBrochure.BrochureSent)=0));



I think what is causing the problem is that i am making it add 1 to
the customer number each time



ANy help would be great
 
S

storrboy

I think you are right. What you will probably have to do is apply the
customer number to each row in the source table before you try to
append them in the destination table. The DMax will only return one
number because untill all records are inserted and the transaction is
committed, those new rows don't actually exist. They sit in a buffer
until the whole process either succeeds or fails. As far as Access is
concerened, the DMax value dosen't change. If that field is indexed
and does not allow duplicates, the remaining rows will not be appended.
 

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