Solved

Sql code problem

Posted on 2016-10-09
6
18 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 Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now