Results 1 to 7 of 7
  1. #1
    veveyen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3

    How to crate all UNIQUE values in a 4 x 4 matrix table

    say, if I got a 4 x 4 matrix table - 4 rows and 4 columns - MS Access 2007/2010

    the values should exist as below with no repetition of any number in any of the cells.


    1 2 3 4
    5 6 7 8
    9 10 11 12
    13 14 15 16

    a number should not repeat in any of the cells.
    I set a primary key on cloumn 1 and defined unique on all the fileds but that doesn't help
    since 1 columns does not know what the other cell contains and no relationship exists.

    Any help would be highly appreciated

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    In Access there are no "cells"; and no 4x4 matrix as such. Access has Tables that contain rows(records) and each row has 1 or more columns(fields).

    Here is a link to an Access reference/tutorial.
    http://www.accessmvp.com/strive4peace/

  3. #3
    veveyen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Thanks Mate!! sorry if I didn't put it right.
    I meant, say create a table in Access, that has 10 odd columns with 10 rows(records),
    All 10 columns are 'number' data type.
    I use a bar code scanner to insert data into this table.

    I would like to insert data into this table such that there is no repeat of any value, as I stated in the above example I've given in the problem statement.
    in a way, I would like to achieve all the 'field' values - UNIQUE - Is that feasible in Access

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    ??? So you have a table, the table will have 10 records, and each record will have 10 fields. If no repeat in any value you'd have 100 values.
    Does this Table have a name? Do the fields have names?If you use 1-100 you should have all UNIQUE values.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You appear to be thinking in "Spreadsheet". Like Orange said, there are no cells, even though datasheet view looks like a spreadsheet.

    So does it have to be a 10 X 10 matrix? If was one field by 100 rows, you can set the field to not allow duplicates - no code required.

    If you must have ten fields per record, you can set each field to have unique values and write some code to check that each field in a record (row) is unique.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I agree with ssnafu, your matrix shouldn't be stored in the format you're showing. Let's say have a matrix of length and width and the values in your matrix are area your 'matrix' table would look like:

    Code:
    ItemLen  ItemWid  Item Area
    1        1        1
    1        2        2
    1        3        3 
    2        2        4
    1        5        5
    2        3        6
    etc...
    Then you can make your ItemArea field a unique key field and never have to worry about duplicates appearing.

  7. #7
    veveyen is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Quote Originally Posted by veveyen View Post
    say, if I got a 4 x 4 matrix table - 4 rows and 4 columns - MS Access 2007/2010

    the values should exist as below with no repetition of any number in any of the cells.
    1 2 3 4
    5 6 7 8
    9 10 11 12
    13 14 15 16

    a number should not repeat in any of the cells.
    I set a primary key on cloumn 1 and defined unique on all the fileds but that doesn't help
    since 1 columns does not know what the other cell contains and no relationship exists.

    Any help would be highly appreciated
    Quote Originally Posted by orange View Post
    In Access there are no "cells"; and no 4x4 matrix as such. Access has Tables that contain rows(records) and each row has 1 or more columns(fields).

    Here is a link to an Access reference/tutorial.
    http://www.accessmvp.com/strive4peace/
    Quote Originally Posted by veveyen View Post
    Thanks Mate!! sorry if I didn't put it right.
    I meant, say create a table in Access, that has 10 odd columns with 10 rows(records),
    All 10 columns are 'number' data type.
    I use a bar code scanner to insert data into this table.

    I would like to insert data into this table such that there is no repeat of any value, as I stated in the above example I've given in the problem statement.
    in a way, I would like to achieve all the 'field' values - UNIQUE - Is that feasible in Access
    Quote Originally Posted by orange View Post
    ??? So you have a table, the table will have 10 records, and each record will have 10 fields. If no repeat in any value you'd have 100 values.
    Does this Table have a name? Do the fields have names?If you use 1-100 you should have all UNIQUE values.
    Quote Originally Posted by ssanfu View Post
    You appear to be thinking in "Spreadsheet". Like Orange said, there are no cells, even though datasheet view looks like a spreadsheet.

    So does it have to be a 10 X 10 matrix? If was one field by 100 rows, you can set the field to not allow duplicates - no code required.

    If you must have ten fields per record, you can set each field to have unique values and write some code to check that each field in a record (row) is unique.
    Thank you all for your replies.
    You are correct!! I have to look at it in the right view as MS access requires

    Appreciate all your replies and time once again

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

Similar Threads

  1. Unique values
    By helpaccess in forum Queries
    Replies: 3
    Last Post: 09-19-2011, 03:46 PM
  2. Duplicate Query Reporting Unique Values...
    By Tomfernandez1 in forum Queries
    Replies: 5
    Last Post: 04-19-2011, 04:22 PM
  3. Creating a unique ID for a new set of values
    By slaterino in forum Programming
    Replies: 1
    Last Post: 08-24-2010, 09:35 AM
  4. Unique Values and Boolean Fields
    By Triad in forum Forms
    Replies: 1
    Last Post: 07-15-2010, 06:28 PM
  5. Count of Unique Values
    By vsmk in forum Queries
    Replies: 2
    Last Post: 03-14-2010, 12:07 AM

Posting Permissions

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