Solved

Sql code problem

Posted on 2016-10-09
6
25 Views
Last Modified: 2016-10-09
Can some one see what I am doing wrong here? I get variable not defined on ChangeCheck. Probably missed a dammed commer somewhere

        strSQL = _
            "INSERT INTO Sets (ItemNumber, DoorNumber, Batch, Location, ChangeCheck) " & _
            "SELECT " & lngNewID & " AS ItemNumber, DoorNumber, Batch, Location, ChangeCheck " & _
            "FROM Sets " & _
            "WHERE (ItemNumber=" & lngOldID And ((ChangeCheck) = -1)
        CurrentDb.Execute strSQL, dbFailOnError
0
Comment
Question by:DatabaseDek
  • 4
  • 2
6 Comments
 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 41835817
I get variable not defined on ChangeCheck.

Then ChangeCheck either not exists or is misspelled.

And/or correct this as:

    "WHERE (ItemNumber=" & lngOldID & " And ChangeCheck = -1)

/gustav
0
 

Author Closing Comment

by:DatabaseDek
ID: 41835820
Thank you
0
 

Author Comment

by:DatabaseDek
ID: 41835822
Gustav are you on the list of people that can contract for projects? I have a simple one that need help
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 49

Expert Comment

by:Gustav Brock
ID: 41835823
Yes, feel free: gustav[@]cactus.dk
0
 

Author Comment

by:DatabaseDek
ID: 41835846
Hi Gustav

I believe it has to go through EE How do I find you?
0
 

Author Comment

by:DatabaseDek
ID: 41835853
Hi Gustav

Here is the Link to project

Normally I would suggest reading the posts but I would not if I were you. The problem as Pat Hartman says is simple. each expert commenting has made it more and more difficult. If you just leave a message I will post you a simple question

https://www.experts-exchange.com/gigs/2507/Solving-a-query-problem.html
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question