Results 1 to 7 of 7

sudoku expression in append query

  1. #1
    EdKerm is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7

    sudoku expression in append query

    hi all - what would the criteria expression be to do the following - line (or column) of nine single digit number cells, that may either be null or have a value between 1 and 9. I have two queries that return correct results for each cell - each of the 81 cells has its own grid reference (from a1 to i9), by the way, and the 9 columns are numbered 1 to 9, the nine rows are a to i. So, i am creating an append query to add separately the results of each of the above two queries to a table called “possvals”. My problem is in working out an appropriate expression that gives only the possible values for each cell in (say) line a that is “null” and that follows the sudoku rule- ie no value can appear twice in any one row or column. I thought maybe the expression would be something such as -



    = >0 and <10 and/but not equal to “the not null values found in the ‘line a’ query” —- to put it in layman’s language ...

    As you can see, I am struggling due to miniscule access experience but hopefully this makes some sense as to what I’m getting at.

    can you suggest some code that would work? Ed

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,722
    Comparing values of fields in same record gets complicated when many fields are involved. Suggest write a VBA function to validate data for each row to determine if value is repeated. Otherwise, normalize table structure.

    What is purpose of this data?
    Why are you appending to another table?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    EdKerm is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7
    Hi

    thanks for responding. If you are experienced in solving sudoku puzzles, read on. If not, the following will make little sense, and that's OK, don't try and work it out, I will keep on trying to figure out a way on my own (even though I can't do VBA coding at all),

    I am just tinkering with an idea - to create in MS Access 2007 a routine that works out for each/any of the unknown cells in any sudoku puzzle ie solves the whole puzzle (no matter what the given numbers are, or which of the 81 cells in the puzzle have given numbers --

    A) what the possible numbers are, and then B) by progressive calculations and further elimination of existing numbers, what the final solution is

    I won't have time to further elucidate for the next month or so, unfortunately

    but thanks anyway EdK

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    14,016

  5. #5
    EdKerm is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7
    Great! Very neat!! thanks very much, Orange EdK

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    47,722
    I just did a quick Bing search for 'Access VBA sudoku' and got returns for Excel and VB and VB.net.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    EdKerm is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2016
    Location
    Australia
    Posts
    7
    Thanks June7 for providing those links. It looks like Excel is the way to go with Sudoku. But I am loathe to give it away as I have set myself this challenge even though I know almost nothing re VBA coding. I will have to leave it for now, though, as I have other priorities. EdK

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 19
    Last Post: 10-03-2017, 09:10 AM
  2. Access can't append all the records in the append query
    By fluffyvampirekitten in forum Access
    Replies: 2
    Last Post: 08-27-2015, 01:53 AM
  3. Replies: 1
    Last Post: 06-14-2015, 09:48 AM
  4. Append SQL Statement expression
    By Jgk in forum Queries
    Replies: 5
    Last Post: 05-16-2014, 05:56 PM
  5. Replies: 1
    Last Post: 03-23-2010, 04:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums