Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    63

    Unanswered: Quick Combo box question

    Good AfterNoon,

    I have "tblSAEs" which has combine PK of SAENo and ParticipantsNo.

    Now on my form each time i'm trying to filter out SAENo based on what user slects in "cboParticipatnsNo" to do this i'm using following query for "CboSAENo" but for some reason its not working for me. Is there anything wrong with the query or its just not working because i have combine PK key ? If it because of combine PK is there any other way to do this task ?

    Code:
    SELECT tblSAEs.SAENo
    FROM tblSAEs
    WHERE (((tblSAEs.SAENo)=[forms]![frmMain]![cboParticipantsNo]));

  2. #2
    Join Date
    Sep 2003
    Location
    Caldes de Malavella, Spain
    Posts
    244
    Are both fields in the PK numerical fields?

    If SAENo is text, for example, your SQL would have to be "SELECT tblSAEs.SAENo
    FROM tblSAEs
    WHERE (((tblSAEs.SAENo)='" &[forms]![frmMain]![cboParticipantsNo])) &"'";

    Also, when you say it's not working, precisely what happens when you run it?
    Andy Briggs
    Elmhurst Solutions Limited
    Database Development and Consultancy
    http://www.elmhurstsolutions.com

  3. #3
    Join Date
    May 2004
    Posts
    63
    andybriggs,

    I try using your SQL statement but i get Syntex error.

    Also, when i run Query the way it was before i just don't see anything in "CboSAENo" so bacically its not filtering out based on cboParticipantsNo.

    Yes, SAENo & ParticpantsNo are both Text datatype

    Thanks In Advance

  4. #4
    Join Date
    Sep 2004
    Location
    Kuala Lumpur
    Posts
    60
    You wrote:
    SELECT tblSAEs.SAENo
    FROM tblSAEs
    WHERE (((tblSAEs.SAENo)=[forms]![frmMain]![cboParticipantsNo]));

    Don't you mean:
    ...
    WHERE (((tblSAEs.ParticipantsNo)=[forms]![frmMain]![cboParticipantsNo]));

    wazz

Posting Permissions

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