Advertisement

07.15.2008 at 07:04PM PDT, ID: 23568301
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.5

Insert SQL statement using 2 tables and user input fields

Asked by BobRosas in Access Forms, SQL Query Syntax

Tags: ,

tblOFInvDetail
   OFInvDetailID  Auto Key
   OfInvDetail  
   Company Code

tblOFInventory
   OFInventoryID  Auto Key
   OFInvTypeId    Not required
   OFInvDetailID   Numeric key from other table
   CompanyCode

The user wants to be able to Add a record to tblOFInventory but the record has to exist in tblOFInvDetail first.  My insert into tblOFInvDetail works but I need to then use the key created (in 1st tbl) as a field in tblOFInventory and Im not sure how to do that.  Im trying to insert into tblOFInventory the key from tblOFInvDetail where OFInvDetail = the users NewData (OFInvDetail) input.  


strNewSQL = "INSERT INTO tblOFInvDetail (OFInvDetail, CompanyCode) VALUES ('" & NewData & "','" & Me.txtHidCurrentCo & "')"
        DoCmd.SetWarnings False
        DoCmd.RunSQL strNewSQL
        Response = acDataErrAdded
***The Above all works.  A record is inserted.  The following does not.
Error = Syntax error, missing operator in query expression.

        strNewSQL2 = "INSERT INTO tblOFInventory ( OFInvDetailID, CompanyCode )        SELECT tblOFInventory.OFInvDetailID FROM tblOFInventory INNER JOIN tblOFInvDetail ON tblOFInventory.OFInvDetailID = tblOFInvDetail.OFInvDetailID
VALUES ('" & NewData & "','" & Me.txtHidCurrentCo & "')"
        'DoCmd.SetWarnings False
        DoCmd.RunSQL strNewSQL2
        DoCmd.SetWarnings True
        Response = acDataErrAdded

Thanks in advance.
Start Free Trial
 
Loading Advertisement...
 
[+][-]07.15.2008 at 07:47PM PDT, ID: 22012932

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.15.2008 at 07:50PM PDT, ID: 22012941

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.15.2008 at 07:53PM PDT, ID: 22012962

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.15.2008 at 07:59PM PDT, ID: 22012987

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: Access Forms, SQL Query Syntax
Tags: SQL, Microsoft Access
Sign Up Now!
Solution Provided By: frankytee
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.16.2008 at 08:58AM PDT, ID: 22017231

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.16.2008 at 04:13PM PDT, ID: 22021021

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.16.2008 at 04:17PM PDT, ID: 22021039

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628