Results 1 to 11 of 11
  1. #1
    Join Date
    Sep 2008
    Posts
    20

    Exclamation Unanswered: Parameter query error

    Hi GUYS


    I have 2 Tables One is Staff:

    Staff ID (PRIMARY KEY)
    Staff Name


    The Staff name field above is related to the table below:

    Log:

    Log ID (Primary Key)
    Staff
    Date
    Other..

    The staff field in the log table is a lookup table of the staff name in the staff table which works great on forms and tables but when i try to do a parameter query that searches by date range and then staff name it only takes the staff members id number not name even thought the correct info is shown on the actual query if i enter the staff id number. (it shows name not id on query report)

    Any Help?

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    I suspect this is your problem:

    http://www.mvps.org/access/lookupfields.htm
    Paul

  3. #3
    Join Date
    Sep 2008
    Posts
    20
    That sounds like my problem! What can i do i need the lookup field!

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    You just code it yourself. For your parameter query, you base it on a combo that has both ID and name in it. The ID field is the bound column, but you display name.
    Paul

  5. #5
    Join Date
    Sep 2008
    Posts
    20
    Man that means nothin to me! im a newbie at access! anny instructions lol?

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    don't use lookup fields
    create a RI link between staff and log using StaffId as the Fk in log to the PK in Staff
    dont use the lookup wizard.. it may be fine for a few tables, but its not robust enougt for a 'real' application. in short its crap if your application is intended to be a workng application
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Sep 2008
    Posts
    20
    Im sorry i sound so unclued up to this bu i still can'tfigure out what i have to do for it to accept a name as a parameter not the number

    i can delete the relationship then what do i need to do? i don' understand RI FK or PK!!

    This surely can't be that difficult!! i feel stupid

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    The first thing you should do is create a query that joins the two tables together so that you can see log details and staff names. Then you can work towards using names for the criteria.

    Stupid table lookup options... they do nothing but confuse new users. Microsoft should NEVER have introduced the stupid things.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by pundabuyer
    i can delete the relationship then what do i need to do? i don' understand RI FK or PK!!

    This surely can't be that difficult!! i feel stupid
    You are nto stupid for not knowing things - you would be stupid if you knew about this stuff but didn't put it into practice.

    Two good database design articles - take your pick:
    http://www.tonymarston.net/php-mysql...se-design.html
    http://r937.com/relational.html

    RI = Relational Integrity
    FK = Foreign Key
    PK = Primary Key

    Mark basically means set up a relationship between the two tables. This creates a foreign key based on the referenced table's primary key. This will enforce relational integrity. Read the articles - it's all in there
    Testimonial:
    pootle flump
    ur codings are working excelent.

  10. #10
    Join Date
    Sep 2008
    Posts
    20
    Thanks for that im going to have a read of the articles! Much appreciated!

    Andy

  11. #11
    Join Date
    Sep 2008
    Posts
    20
    I just thought i'd let you know i have sorted the problem due to your reply and article thank you so much!!


    ANDY

    P.S I may have another puzzle to fix!!

Posting Permissions

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