• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 52
  • Last Modified:

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
0
DatabaseDek
Asked:
DatabaseDek
  • 4
  • 2
1 Solution
 
Gustav BrockCIOCommented:
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
 
DatabaseDekAuthor Commented:
Thank you
0
 
DatabaseDekAuthor Commented:
Gustav are you on the list of people that can contract for projects? I have a simple one that need help
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Gustav BrockCIOCommented:
Yes, feel free: gustav[@]cactus.dk
0
 
DatabaseDekAuthor Commented:
Hi Gustav

I believe it has to go through EE How do I find you?
0
 
DatabaseDekAuthor Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now