Results 1 to 4 of 4
  1. #1
    gabrielnerf is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    2

    Running Parameter Requires Table ID# Not Field Name

    When I try to set a parameter for my inquiry, Access is looking for the table ID# instead of the text in the field I'm looking for.

    eg:

    Table- Inspection Results

    ID Inspection Results
    1 Pass
    2 Fail
    3 Non-rated

    When I run a parameter inquiry requirement to look for inspection results, and I type the word "Pass" in, I receive an error. But, when I type "1" in, I get the information I'm looking for (all records with inspection results that were a "Pass"). Why is Access looking for the table ID number instead of the text value?

    Could it be because the ID# is set as the Primary Key?



    Any help would be greatly appreciated!

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Because you are doing a search on a field that has the ID value, not the descriptive Results.

    Do you have Lookup set for the ID field in table that is being searched? This Lookup does not change the value in the field, even if you see the descriptive alias, the actual value is still the ID.
    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
    gabrielnerf is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    2
    Yes it is a lookup in the table...if I change the field, will it mess up my relationships and other data?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Change the field how? Why should you? The search on the ID is just as effective as the search for a word.

    If you change the PK to the descriptive field, you will have change the foreign key data in all the related records.
    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.

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

Similar Threads

  1. Replies: 1
    Last Post: 01-29-2012, 01:06 PM
  2. Replies: 1
    Last Post: 03-05-2011, 03:05 PM
  3. VB Editor requires password
    By Desstro in forum Import/Export Data
    Replies: 7
    Last Post: 02-24-2011, 12:04 AM
  4. Running parameter queries from VBA
    By John Southern in forum Programming
    Replies: 6
    Last Post: 03-25-2010, 10:24 AM
  5. Display Query Value That Requires Input Parameter
    By Access::Student in forum Access
    Replies: 1
    Last Post: 05-29-2009, 08:43 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
  •  
Other Forums: Microsoft Office Forums