Results 1 to 6 of 6
  1. #1
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52

    Query with criteria that is linked to the record that is showing on your form

    Hello,

    I have a simple query that pulls from two tables- Personal Details and Salary.

    I also have a Personal Details form which I have placed a command button to run the query.

    In the query I have set the criteria so that is shows the salary info based on the record that I am currently viewing in the Personal details form> [Forms]![PersonalDetails]![ID]

    I have got this to work but only somes as when I click the command button to run the query it sometimes pops up with the criteria and I have to manually input the ID number, any ideas why this keeps happening?



    Ross

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Perhaps the control called [ID] has no value when this happens. This could be the case on a new record or one which has not yet been saved to the table.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52
    Hi Bob,

    Only got two records in the database currently.

    Ross

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Can you post a copy of the db for us to play with
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    rosscortb is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jan 2011
    Posts
    52
    Hi Bob,

    Came in to work and opened and it seems to be working each time now. Thanks anyway.

    Ross

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by rosscortb View Post
    Hi Bob,

    Came in to work and opened and it seems to be working each time now. Thanks anyway.

    Ross
    Good Let us know if the problem reoccurs
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 4
    Last Post: 10-27-2014, 10:26 AM
  2. Record not showing in form
    By Lough in forum Forms
    Replies: 10
    Last Post: 04-18-2012, 11:56 AM
  3. Query criteria in linked table
    By kjlogue in forum Queries
    Replies: 2
    Last Post: 10-06-2011, 11:56 AM
  4. Replies: 3
    Last Post: 06-27-2009, 03:53 PM
  5. Criteria added to Query - Nothing showing
    By eabtx in forum Queries
    Replies: 1
    Last Post: 03-02-2009, 10:06 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