Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    4

    Angry Unanswered: Question: Select Top 1 query as Row Source in Access Form

    I have a combbox in an Access Form and I want only 1 row to show in the combox list.

    I used the Select Top 1 query as Row source, but it still gives me multiple rows. However, when I run this Select Top 1 query itself, it gives me only one row.

    Help needed! Thanks

  2. #2
    Join Date
    Feb 2004
    Posts
    214

    ...

    I have tried it and I have no problem using a top 1 query in a combo box.
    Check your row source again and check the query again.

    Also, can you give more info about the query supplying the data for the combo, what other criteria is there. Also, it might help to know the purpose of why you have a comobox which usually has multiple items by nature is being limited to just one item.
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  3. #3
    Join Date
    Nov 2008
    Posts
    4
    Hi, mr. blonde,

    Thank you for your reply.

    The other properties:

    List Rows 8
    List width Auto
    Limit to List No
    Auto Expand Yes
    IME Hold No
    IME Mode No control

  4. #4
    Join Date
    Feb 2004
    Posts
    214

    ...

    Why are you limiting the combo to just the top 1? It seems a little counterintiutive.

    Where does that value come from, how does it tie into the form and on each record. Does the top 1 value change from record to record?
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  5. #5
    Join Date
    Nov 2008
    Posts
    4
    The value comes from a table, and in that table, I have a few records under the same Field 1, but with different Field 2, thus the filed i want have different values. So I always want the field value on the top 1 record when the field 1 value meets my criteria (another combox value in this form).

    Thanks

  6. #6
    Join Date
    Feb 2004
    Posts
    214

    ...

    Can you post an example of the data in the tables.
    Also can you provide simple walkthrough of how the combo's will work, e.g. "if my combo1 value from the table is equal to _____ then I want combo2 value to be______"
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

  7. #7
    Join Date
    Nov 2008
    Posts
    4
    ATR Name MonthTwoDigit Quarterly?
    St. Vincent ER Physicians 5 Yes
    St. Vincent ER Physicians 11 No
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    mr. blond,

    The above is my data example. What I want is to select the first [Quarterly?] field when my other combox value equals St. Vincent ER Physician.

    I am really confused now. Run the seperate query will give me good result but not in the combox list.

    Thanks!:

  8. #8
    Join Date
    Feb 2004
    Posts
    214
    ATR Name MonthTwoDigit Quarterly?
    St. Vincent ER Physicians 5 Yes
    St. Vincent ER Physicians 11 No


    The query should look like this in the criteria under ATR Name
    [Forms]![Your Form Name]![Your Quarterly Combo Name]

    Then, instead of using a 2nd combo box, since you only have 1 value, make it an unbound text box and the data source will be your query and should return St. Vincent.

    You will need to create a some vb code on the first combo box.
    After_Update
    Your Unbound Text Box Name.requery
    You know, I'm sick of following my dreams, man. I'm just going to ask where they're going and hook up with 'em later

Posting Permissions

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