Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Trying to set combobox data in gotFocus event problem

    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?
    Last edited by weyrman; 2011-05-25 at 22:42. Reason: Experimented
    "Heading for the deep end"

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    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.
    Wendell

  3. #3
    Lounger
    Join Date
    Feb 2011
    Posts
    43
    Thanks
    0
    Thanked 6 Times in 6 Posts
    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

Posting Permissions

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