Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2010
    Location
    New Jersey
    Posts
    18

    Red face Unanswered: Over my head in nj

    Guys...

    I am in need of some serious help here and I seem to be above my knowledge base as far as Access goes......

    Details

    Created a Database to collect information from Blood Receipts (Bags), these bags are scanned with a hand-held and stored as show below

    http://i170.photobucket.com/albums/u...TONS/FORM1.jpg

    Later we receive a report that I will import from Excel into Access (looks like this)

    http://i170.photobucket.com/albums/u...ONS/TABLE2.jpg

    The common information here is the scanned BAG ID, step one I would like Access to identify Bag IDs that have the following letters under any of the test columns "X", "P" and "R", if any or all are present I need Access to let me know by changing the color of the Bag ID (or something)....

    THEN.....I need Access to compare and identify the matching numbers that were initially scanned.......

    Impossible???

    HELP!!!!!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Not impossible at all. What do you have so far?
    Have a nice day!

  3. #3
    Join Date
    Nov 2010
    Location
    New Jersey
    Posts
    18
    Quote Originally Posted by Sinndho View Post
    Not impossible at all. What do you have so far?
    I have the DB set up to accept the Hand-Held scans of the Bags....

    I have the ability to convert the PDF Report we receive into Excel so I can import into Access.

    I have imported the Excel Data into Access as it's own Table

    I have mimmicked the the DB Form to have the same column headings as the imported report.

    That's really all I have......

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    So you have two tables: One with the Hand-Held scans of the Bags (Table_A) and one with the data form Excel (Table_B). Both tables have a column containing the BAG ID (Bag_ID) which should probably make a good candidate as primary keys in both tables.

    From there, its easy to create a query that will find the matching rows in both tables. Something like:
    Code:
    SELECT Table_A.Bag_Id, Table_A.Some_Data
    FROM Table_A LEFT JOIN Table_B ON Table_A.Bag_Id = Table_B.Bag_ID
    WHERE (Table_B.Bag_ID Is Not Null);
    Does this show you a possible path of development?
    Have a nice day!

  5. #5
    Join Date
    Nov 2010
    Location
    New Jersey
    Posts
    18
    Quote Originally Posted by Sinndho View Post
    So you have two tables: One with the Hand-Held scans of the Bags (Table_A) and one with the data form Excel (Table_B). Both tables have a column containing the BAG ID (Bag_ID) which should probably make a good candidate as primary keys in both tables.

    From there, its easy to create a query that will find the matching rows in both tables. Something like:
    Code:
    SELECT Table_A.Bag_Id, Table_A.Some_Data
    FROM Table_A LEFT JOIN Table_B ON Table_A.Bag_Id = Table_B.Bag_ID
    WHERE (Table_B.Bag_ID Is Not Null);
    Does this show you a possible path of development?
    In matching the Bag IDs up yes, but it's the other facet of the process I am having an issue with....the scanned report has 9 columns and each has a letter or letters (NR, R, P, X)....i need to identify the Bag IDs that have any of the following letters in any of the 9 columns (X, P or R) if any of those 3 letters show up in any of the nine columns, I need the Bag ID identified and THEN located on Table A

  6. #6
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,418
    Provided Answers: 7
    Don't under stand all of it but what about
    joining the 9 columns as 1 coloumn

    Check:col1 & col2 & Col3 & col4 ......

    then put a Like statement in the Criteria
    Like "*NR*" or Like "*R*" or Like "*P*" .....

    That would show what bag have those codes into

    then a other Query
    Check:col1 & col2 & Col3 & col4 ......

    Like "*X*" or "*P*" or "*R*"
    that show you those code

    * = wildcard
    Last edited by myle; 03-29-11 at 06:06. Reason: spelling
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  7. #7
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Myle's idea is interresting but would cause false matches because a column containing 'NR' would match Like '*R*'. This can be solved by adding delimiters to the contents of each concatened column, then create the join to the other table:
    Code:
    SELECT Table_A.*, Table_B.*
    FROM Table_A INNER JOIN Table_B ON Table_A.Bag_ID = Table_B.Bag_ID
    WHERE (('|' & [Table_B].[Col1] & '|' & [Table_B].[Col2] & '|' & [Table_B].[Col3] & '|' & [Table_B].[Col4] & '|' & [Table_B].[Col5] & '|' & [Table_B].[Col6] & '|' & [Table_B].[Col7] & '|' & [Table_B].[Col8] & '|' & [Table_B].[Col9] & '|') Like '*|R|*' 
    Or 
    ('|' & [Table_B].[Col1] & '|' & [Table_B].[Col2] & '|' & [Table_B].[Col3] & '|' & [Table_B].[Col4] & '|' & [Table_B].[Col5] & '|' & [Table_B].[Col6] & '|' & [Table_B].[Col7] & '|' & [Table_B].[Col8] & '|' & [Table_B].[Col9] & '|') Like '*|P|*' 
    Or 
    ('|' & [Table_B].[Col1] & '|' & [Table_B].[Col2] & '|' & [Table_B].[Col3] & '|' & [Table_B].[Col4] & '|' & [Table_B].[Col5] & '|' & [Table_B].[Col6] & '|' & [Table_B].[Col7] & '|' & [Table_B].[Col8] & '|' & [Table_B].[Col9] & '|') Like '*|X|*');
    Have a nice day!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •