Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2006
    Posts
    65

    Unanswered: combo box and filter button form

    Hi I am trying to create a form which consists of a combobox displaying client ref No accompanied with a button when clicked will return a form displaying all records associated with the client ref No.

    I have already created a seperate form which displays all the records of the clients

    When i click the button, it opens the form but the form does not display any records,

    what am i doing wrong, can anyone please advise

    many thanks

  2. #2
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    Do you have the form bound to a query that is based on your combo box? One way would be to create a query that references the first form's combo and use that as the recordset for the second form that displays all the records.

    Does that make sense? If not reply and I'll try to explain a little clearer.

    C

  3. #3
    Join Date
    Apr 2006
    Posts
    65
    It is an unbound combobox if that means anything

  4. #4
    Join Date
    Jul 2004
    Location
    South Dakota
    Posts
    267
    Don't worry about the combo box...you need to put something in the recordsource for the second form (form that displays the results). Something like: SELECT * FROM myTable WHERE RefNo = " & Forms!Form1!cboRefNo

    Make sure that the first form stays open otherwise this approach will not work. Give that a try and let me know.

    C

  5. #5
    Join Date
    Apr 2006
    Posts
    65
    sorry i am a beginner, i couldn't find record source, i put the query in the field of the form in control source
    and it didnt work!
    Last edited by waylander; 02-06-08 at 12:39.

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Well if you couldn't find the right property, you shouldn't be too surprised that things don't work.

    As soon as you open the form in Design, go to Properties and Record Source should be one of the first properties visible.

    Is this homework?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Apr 2006
    Posts
    65
    hi i am sorry i do not see record source in properties of the form in design view, i am using 2003 if that makes any difference

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    When you go to properties for your form, make sure the "ALL" or "DATA" tab is selected. The Record Source property MUST be there. All versions of Access have it.

    When the property sheet is open, it should say "Form" at the top. If it does not, click in the dark grey area outside the boundaries of your form's width/depth to select it. You can also click the little box to the left of the top ruler.
    Last edited by StarTrekker; 02-07-08 at 06:55.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    Apr 2006
    Posts
    65
    Hi I am making some progress now, i have located the recordset and entered the following query SELECT * FROM Marac2 WHERE Guardian_Reference = " & "'" & Form1![Combo0] '" - but i am getting syntax error, missing operator

  10. #10
    Join Date
    Apr 2006
    Posts
    65
    i have put the following SQL in the row source of the combo box and it is now returning records in the form
    SELECT Marac.Guardian_Reference FROM Marac;

    however, the combobox is not listing any values in the dropdown

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    SELECT * FROM Marac2 WHERE Guardian_Reference = '" & Form1![Combo0] & "'"

    That's cleaner btw, but your current SQL is preferable.

    Now you need to configure the combo box to display what you want it to. Use it's Row Source property and Column Count property to do that.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  12. #12
    Join Date
    Apr 2006
    Posts
    65
    Its working well now, thanks very much for your support, have a wonderful day!

  13. #13
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Good stuff! Cheers
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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