Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2005
    Posts
    183

    Unanswered: Combobox rowsource in subform

    As you can see from the following key, I'm creating a text string to be used in a rowsource for a combobox. However, this combobox is part of a table viewed in a subform, so getting the right reference to the combobox object rowsource seems to bug me to hades, as I keep getting a 424 object required.

    I've been trying a few differnet models.. one referring through the subform itself to the field, another directly to the table and then refresh the subform to get the changes. But neither seem to work. As if I'm missing some very basic here that I don't quite understand.

    Code:
        midlertidigttal = 0
        
        midlertidigttal = rs_matchtabel.Fields.Count
        
        For i = 0 To midlertidigttal - 1
            tilfelter = tilfelter & "[" & rs_matchtabel.Fields(i).Name & "];"
        Next i
        
        midlertidigttal = 0
        
        midlertidigttal = Len(tilfelter)
        midlertidigttal = midlertidigttal - 1
        
        tilfelter = Left(tilfelter, midlertidigttal)
    
        'Me.subobject_tabel![til excel].RowSourceType = "Value List"
        'Me.subobject_tabel.SourceObject = ""
        
        'Me.subobject_tabel.Requery
        
        'Me.Refresh
        
        Tables![LABELMATCH_tabelmatch]![til excel].RowSource = tilfelter
        
        'Me.subobject_tabel.SourceObject = "[LABELMATCH_tabelmatch]"
           
        Me.subobject_tabel.Requery
        
        Me.Refresh
    thanks for the help!

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Try:

    Me.SubFormControlNameHere.RowSource=YourSourceStri ngHere
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Maybe I am being a thicky pants but... isn't your eventual string a bit odd anyhoo? Something like:

    Code:
    Me.SubFormControlNameHere.RowSource= Field1;Field2;Field3
    ??
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by pootle flump
    Maybe I am being a thicky pants but... isn't your eventual string a bit odd anyhoo? Something like:

    Code:
    Me.SubFormControlNameHere.RowSource= Field1;Field2;Field3
    ??
    Dan ... Huh? I'm not following your observation ... If the poster does a Value List then each item will need a token delimiter (as noted) ... I wasn't paying attention or was suffering from caffiene deficiency assuming that this was a Table binding and Requery ...

    They do have a big issue tho: Value Lists don't work real well in subforms (aasuming the subform in question is Continuous) ... But we won't tell ...
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by M Owen
    Dan ... Huh? I'm not following your observation ... If the poster does a Value List then each item will need a token delimiter (as noted) ... I wasn't paying attention or was suffering from caffiene deficiency assuming that this was a Table binding and Requery ...

    They do have a big issue tho: Value Lists don't work real well in subforms (aasuming the subform in question is Continuous) ... But we won't tell ...
    I don't have the coffee excuse - I've been up for the last 8 hours

    Um - actually I think I don't understand any of it anymore. Combo box or subform record source? And the combo is in the table? I can't help but feel that if the recordsource is going to be dynamic the combo should be part of the presentation rather than db schema. But maybe I've had too much coffee....
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by pootle flump
    I can't help but feel that if the recordsource is going to be dynamic the combo should be part of the presentation rather than db schema.
    Or - specify the source for the combo as a table's contents and dynamically change these.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by pootle flump
    I don't have the coffee excuse - I've been up for the last 8 hours

    Um - actually I think I don't understand any of it anymore. Combo box or subform record source? And the combo is in the table? I can't help but feel that if the recordsource is going to be dynamic the combo should be part of the presentation rather than db schema. But maybe I've had too much coffee....
    Ah DAMN! Just got what you pointed out that I missed ... Um:

    Me.SubFormControlNameHere!ComboboxNameHere.RowSour ce=" Blah Blah Blah ..."

    Like I said ... Not enough caffiene. Have new machine and no access to my code ...
    Back to Access ... ADO is not the way to go for speed ...

  8. #8
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by M Owen
    Have new machine and no access to my code ...
    Eek - I hate that. I feel like I've had my left arm cut off whenever that happens.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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