Advertisement

07.23.2008 at 08:08AM PDT, ID: 23588774
[x]
Attachment Details

Insert into help with autonumber.

Asked by CaptainGiblets in Microsoft ADP, Microsoft Access Database, MS SQL Server

Tags: Microsoft, Access, 2003, ADP / SQL backend

i have the attatched code.

When i run the code it creates a new record in tblcustomerdetails, there is also a column in tblcustomerdetails called  AUTO   that is an auto number.  so i dont have a record of it anywhere as it is randomly generated.

i need to refer to this new AUTO created in tblcustomerdetails  in the code below it, so that i can paste that new AUTO into the AUTO field on the second table and still pull the rest of the information off as currently scripted.Start Free Trial
1:
2:
3:
4:
CurrentProject.Connection.Execute _
    "INSERT INTO tblcustomerdetails ([Date Recorded], Name, [trading as name], Legalconstitution, salesperson, [type of application], [ai/kyc], [internal status], [Date sent to SMS], [Date Approved / Declined], [Date Dispatched], [Date Installed], [Date Active]) SELECT [Date Recorded], Name, [trading as name], Legalconstitution, salesperson, [type of application], [ai/kyc], [internal status], [Date sent to SMS], [Date Approved / Declined], [Date Dispatched], [Date Installed], [Date Active] FROM tblcustomerdetails WHERE tblcustomerdetails.auto = " & Me!subbasicc.Form!txtauto & ""
CurrentProject.Connection.Execute _
    "INSERT INTO tblcomments ([Auto], [handepay comments], [Streamline Comments], [Post Log], [handepay comments2], [Post Log Comments]) SELECT * FROM tblcustomerdetails WHERE tblcomments.auto = " & Me!subbasicc.Form!txtauto & ""
[+][-]07.23.2008 at 08:18AM PDT, ID: 22070184

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 08:20AM PDT, ID: 22070218

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 09:12AM PDT, ID: 22070796

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 09:18AM PDT, ID: 22070859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 04:12AM PDT, ID: 22077787

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft ADP, Microsoft Access Database, MS SQL Server
Tags: Microsoft, Access, 2003, ADP / SQL backend
Sign Up Now!
Solution Provided By: LSMConsulting
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628