Results 1 to 9 of 9
  1. #1
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596

    Can fields in Access Tables be referenced by Number?

    Do fields in Access Tables have a 'Number' property that you can use to reference them?

    For example, if you have the following fields:
    EmpID
    FName
    LName
    Department


    Hire_Date
    . . . is there a way to query an employee's Hire_Date by telling Access to return the value that is in the 5th field [Hire_Date]?

    I have never had to do this but I am trying to help with another post where being able to refer to fields by their position in the field list would be helpful.
    https://www.accessforums.net/queries...lds-25339.html

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    In what situation? You certainly can in a recordset:

    Rs(0)

    Would refer to the first field.
    Last edited by pbaldy; 06-04-2012 at 12:25 PM. Reason: somehow everything got jammed onto one line
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Hi Paul,
    Thanks for replying!

    The post that I was looking at:
    https://www.accessforums.net/queries...lds-25339.html
    was indicating a need to be able to get a number [say 5] [the example shows single-digit numbers]
    from a field in Table1 . . .

    and use that number [5] to sum the values:
    In the [5] fields
    After the 8th field in Table2.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Like I said, I know it can be done in a recordset. In a query, I know you can use ordinal position in the ORDER BY clause, but I don't think it works in the SELECT clause. Not clear on what the goal is in that other thread, but my guess is it would have to be done in code anyway.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Thanks, Paul! Appreciate it.
    I hope things are good with you!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Life is good my friend; hopefully for you too!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Quote Originally Posted by pbaldy View Post
    Life is good my friend; hopefully for you too!
    My son just finished his first year in college . . . we seldom see him. I'm having separation anxiety - hoping he stays safe.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I feel your pain. I've got a daughter in England and the other in Nepal. It's like they're trying to get as far away as possible.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    lol . . .
    I shouldn't laugh . . . but Nepal is pretty darned far. It sure looks like she's making a statement!
    I went to school in Darjeeling, India and visited Nepal several times. It was foreign enough for me . . . but they are used to travellers there.

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

Similar Threads

  1. Replies: 0
    Last Post: 05-21-2012, 07:00 PM
  2. Replies: 1
    Last Post: 03-08-2012, 09:17 AM
  3. Replies: 13
    Last Post: 06-20-2011, 12:18 PM
  4. Replies: 2
    Last Post: 04-15-2011, 01:13 PM
  5. Replies: 1
    Last Post: 02-23-2011, 05:11 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