Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Red face Unanswered: Table in designmode and listbox via query

    Hi!

    I want do design my tables in such a way, that most of the functionallity is
    in the tabel and not on a form or via vba.

    How can I in designmode of a table query for the listbox's data using a
    specific field in the row, where the listbox is "openen".

    An example:

    tbl_test:
    Name Age EqualAge
    -----------------------------------------
    A 20
    B 20
    C 20
    D 21
    E 21
    F 21
    G 21
    H 22
    I 22
    J 22

    When I'm standing in the 'Name=E' row and clicking on the listbox of
    "EqualAge", I want a list containing the entries: D,E,F,G.

    How do I use the 'Age' of the row, where the listbox is?

    Something like this, or what:

    SELECT Name FROM tbl_test WHERE this.Age=Age

    Hope you understand my problem.... Please remeber, that I want the Query to
    work in designmode of the table.


    Thanks,
    Martin Jørgensen, Denmark

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    As long as the form is in run mode, this will work:

    SELECT Name FROM tbl_test WHERE tbl_test.Age=Forms!frm_Test!Age;

    And Form_OnCurrent of the form you will need to add the following vba code:

    age.requery

    As long as you are requiring the query to be based on a certain record as chosen by using a form, I don't know how to get it to run in design view.

Posting Permissions

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