Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Question Unanswered: Column name in a combo box

    Is it possible to lookup all columns in a table or query in a combo box ?

    EXAMPLE
    table headdings:
    | Number_Id | Description | Name | Date | Comments |

    should in a combo box look like:

    Number_ID
    Description
    Name
    Date
    Comments

    thanks for any advice

    sincerely
    Vestigo

  2. #2
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    if you mean the table structure then use "Field List" as the row source type of the combo box

    - Saqib

  3. #3
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Red face Correct answer to a wrong question.

    …… my question was not acurate enough.
    I need this field list as an result from a query, but it should look exactly as when using “Row source type: Field List”

    sincerely
    Vestigo

  4. #4
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    No problem just put either the query name or table name as row source and put field list as row source type for that combo box.

    - Saqib

  5. #5
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Question

    Is it possible to get this in a query, without using a combo box ?

    sincerely
    Vestigo

  6. #6
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    I Apologize!... but can't really understand what you want to say? can you please explain the real situation in a bit more detail?...

  7. #7
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Field Names

    Sure, I’ll try to explain.

    I would like to use the “Field Names” of a table to figure out if the table/query contains a specific Field Names. This result should be used to determine what “Field” that should pop up in my Combo box.
    (Only selected fields should pop up, depending on a combination of underlaying table/query and a selection table)



    sincerely
    Vestigo

  8. #8
    Join Date
    Nov 2002
    Location
    Norway
    Posts
    239

    Red face A solution to my problem

    Maybee not the most effecient way to do it, but it function:

    “Report_Query” is a list box with Row Souce Type set to “Field List”

    Dim db As Database
    Dim AccTable, i As Integer
    Set db = DBEngine.Workspaces(0).Databases(0)
    Set AccTable = db.OpenRecordset("tl-Temporary_Used_Fields")
    Myform.Report_Query.RowSource = q-My_Test_Query

    '**** Find Field Names used in Report query/table
    For i = 0 To (Myform.Report_Query.ListCount - 1)
    AccTable.AddNew
    AccTable!FieldName = Myform.Report_Query.Column(1, i)
    AccTable.Update
    Next i
    AccTable.Close

Posting Permissions

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