Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2009
    Posts
    8

    Unanswered: Combo box to query, displayed in text box.

    Hello all,
    I fairly new to access and am working on a project.
    What I need is a combo box that supplies data to a query, and then display the results of the query in a text box.
    I have the combo box and query working properly, I just dont know how to get the query to show up in the text box once something is selected in the combo box.
    Any suggestions?

    Thanks
    Ron

  2. #2
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Link your form on this query.

  3. #3
    Join Date
    Dec 2009
    Posts
    8
    I linked the entire form to the query, but nothing different happens.
    Let me try to explain my circumstances a little better.

    Lets say I'm working with a music database.
    Table1 is Artists containing the artistid and artist
    Table2 is Tracks containing trackid artistid and songtitle

    I have form1 with a combobox that pulls its contents from Artist table and displays the artists

    I have a query that displays the songtitle's for all the songs that is by the selected artist from the combo box.

    What I need is a text box to filled with the results of the query whenever the combo box is changed.

    For example if i select Michael Jackson in the combo box, the text box may contain Thriller, Beet It, and Billy Jean. If I move to a different artist the combo box needs to then display that data.

    Any ideas?

  4. #4
    Join Date
    Dec 2009
    Posts
    8
    Ive gotten this to work a little bit using the dlookup function.
    The problem I am having is that it only will display 1 result.

    I need it to display every result in the query.

    Any ideas on how to accomplish this?

  5. #5
    Join Date
    Apr 2005
    Location
    Zagreb - Croatia
    Posts
    372
    Send a short example of your mdb. Access 2000 or 2002.

  6. #6
    Join Date
    Dec 2009
    Posts
    8
    I got this figured out somewhat.

    What I did was add a select query to the row source of my text box and then use some VBA to make it refresh.
    Code:
    Private Sub Combo_AfterUpdate()
    
        Me.lstResults.Requery
    
    End Sub
    The problem I am having now is trying to add an "ALL" to my combo box that selects all records, but I will start another thread for that.

    Thanks
    Ron

Tags for this Thread

Posting Permissions

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