Avatar of Derek Brown
Derek Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Sql code problem

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
Microsoft Access

Avatar of undefined
Last Comment
Derek Brown

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Derek Brown

ASKER
Thank you
Derek Brown

ASKER
Gustav are you on the list of people that can contract for projects? I have a simple one that need help
Gustav Brock

Yes, feel free: gustav[@]cactus.dk
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Derek Brown

ASKER
Hi Gustav

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

ASKER
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