• Trying to set combobox data in gotFocus event problem

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Trying to set combobox data in gotFocus event problem

    Author
    Topic
    #476846

    I’m attempting to be clever 🙂

    What I am trying to do is to populate a combobox from a recordset. I had:

    cboCust1.RowSource = Me.sbfPOforCurrentJobs1.Form.RecordsetClone

    but think that I need to define a field within the recordset.

    I have a subform that I have set a filter on. I want to populate a combobox from the the filtered subform with the afterupdate event adding the selected value to the existing filter and then re-applying it.

    I hope this makes sense!

    Edit: ok, I tried this:

    cboCust1.RowSource = Me.sbfPOforCurrentJobs1.Form.RecordsetClone.Fields(“Customer”)

    and got the first customer from the list, how do I get all of them?

    Viewing 1 reply thread
    Author
    Replies
    • #1280943

      I think you will have to actually create the SQL string based on the filter applied, and update the combo box RowSource rather than trying to use RecordsetClone. I’ve never had much success trying that approach. Is the Filter string being applied in code? If so you could set the combo box RowSource at the same time.

    • #1281487

      Why on earth would you want to put the form’s recordset in a combo box? Use a continuous form.

      But in any case, how many fields are there in the Recordset close vs columns in the combo box, and does the bound column correspond with the relevant RClone field.

      CR

    Viewing 1 reply thread
    Reply To: Trying to set combobox data in gotFocus event problem

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: