Results 1 to 11 of 11
  1. #1
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7

    PROJECT ROV: If statements across tables

    Hi All,

    I'm pretty new to access and have joined on a project to make a pretty large database. My first question is how do I make an Iif statement across multiple tables? I have the following:

    Table 1
    PID
    NUM

    Table 2
    NUM-TESTVALUE

    Table 3 (needs to be)
    If NUM = NUM-TESTVALUE = "Pass", Else "Fail"

    Thanks in advance

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Create a query based on your table2. create a calculated field Result: in the query grid

    Result: IIF(Num=([Num]-[TestValue), "Pass", "Fail")

  3. #3
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    Thanks for the advice, going to try it out shortly. Just wanted to clarify that table 2 doesn't have a minus sign, it's just one value that I've named NUM-TESTVALUE where - is just a dash. I'll try out your suggestion and thanks again

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    My suggestion is do NOT use the dash in object or field names. It only leads to pain and suffering (along with using any other special characters) and I would avoid using spaces in them as well.

  5. #5
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    Thanks for the advice bob, I'll switch it right away. This is going to be a long term process with a ton of questions so I'll be listing each one and the first part will be PROJECT ROV. Thanks to both of you and we'll see how this first step goes, I suspect there will be at least 25-50 tables by the end of this

  6. #6
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by jrubenol View Post
    I suspect there will be at least 25-50 tables by the end of this
    Then it would be good, if you haven't already done so, is to let us see the table structure as you have designed it, so that any normalization issues can be sorted out before you get too far along.

  7. #7
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    I'll see what I can get up. One of my main issues right now if the limitation of columns (number of columns). We're having to split up things that before were together because there aren't enough columns. Where should I post the structure??

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    I would upload a copy of the database here with just the tables / relationships and maybe some sample (bogus) data in the tables so we can see how it all kind of relates.

  9. #9
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    One issue that I'm having is that the second table only has one row of numbers (these are all just numbers provided by the State of California for ADA accessibility). So I have something like the following:


    Table 1
    Site_Name Length Height
    Record 1
    Record 2
    Record 3
    Record 4
    etc...


    Table 2
    Height Length
    State Required Height (#) State Required Length (#)


    So I want to compare Record 1,2,3,4 etc... length/height to the single corresponding numbers provided in Table 2. Not sure how to query these when they don't have unique keys that correspond. Thanks again

  10. #10
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    I can answer you better with a sample of your database.

  11. #11
    jrubenol is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    Unfortunately I can't really get the design down until I know if this is possible (essentially I don't want to spend the time until I know for certain the following is possible). I'll try to be a bit more clear about what I need to do:

    Table 1 -- Poll Site Accessibility

    Column 1 -- Poll Site ID (Key)
    Column 2 -- Height of Door
    Column 3 -- Width of Door
    Column 4 -- Pass/Fail

    Table 2 -- VAAC Standards
    Column 1 -- Height of Door Requirement (a single record that has a number that reflects the minimum door height requirement)
    Column 2 -- Width of Door Requirement (again, single record)


    So I want to compare Door Height Record 1-10,000 from table 1 (column 2) all to the same value given in Table 2 under Column 1 (which again is just a single record)



    It'd be equivalent to having this in excel:

    = IF (A1 = $B$1,"True","False") -- this is what is in cell A1

    = IF (A2 = $B$1,"True","False") -- this is in A2

    Etc....all the way down to A10000


    Thanks again in advance

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

Similar Threads

  1. IIF() statements
    By ajetrumpet in forum Tutorials
    Replies: 0
    Last Post: 06-17-2011, 06:51 PM
  2. Replies: 1
    Last Post: 03-25-2011, 12:31 PM
  3. IIF statements?
    By staceyo in forum Queries
    Replies: 15
    Last Post: 09-28-2010, 08:45 AM
  4. IIF Statements
    By JDA2005 in forum Queries
    Replies: 8
    Last Post: 07-07-2009, 04:24 PM
  5. If statements
    By Ezeecopy in forum Access
    Replies: 0
    Last Post: 03-24-2009, 04:54 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