Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Location
    Chicago
    Posts
    2

    Question Unanswered: Dynamic Subforms?

    I've created a generic form with a combo box, a list box and a subform - all unbound. The combo box lists all tables in the current db and the list box displays the fields in the selected table. I want to select a field from the listbox and have only that field show up in the subform. So far I can get the entire table to appear by setting the subform's source object to the combo box's value. But this lists everything and I'm trying to filter it down dynamically.

    Help please!

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Question Re: Dynamic Subforms?

    Originally posted by dsharp
    I've created a generic form with a combo box, a list box and a subform - all unbound. The combo box lists all tables in the current db and the list box displays the fields in the selected table. I want to select a field from the listbox and have only that field show up in the subform. So far I can get the entire table to appear by setting the subform's source object to the combo box's value. But this lists everything and I'm trying to filter it down dynamically.

    Help please!
    You want the data that the field contains to appear or the field name from the listbox?

    You can easily assign the subforms recordsource property at runtime to the table that you select and a particular control on the form to the field you have selected. Is this what you want to do?

    Gregg

  3. #3
    Join Date
    Nov 2003
    Location
    Chicago
    Posts
    2
    Sortof - I forgot to mention that I've invoked the subform.form.recordsource property and assigned a sql string to it (too fast) but all the fields still show up with #name? in the data portion except the field I selected. while I do want that data displayed, the others now contain the #name error. I only want to see the selected field's data - effectively filtering to only that field and all it's data.
    Sorry if I wasn't clear - but thanks for the fast response!

  4. #4
    Join Date
    Oct 2003
    Location
    US
    Posts
    343
    You also have to make their visible property false.


    Originally posted by dsharp
    Sortof - I forgot to mention that I've invoked the subform.form.recordsource property and assigned a sql string to it (too fast) but all the fields still show up with #name? in the data portion except the field I selected. while I do want that data displayed, the others now contain the #name error. I only want to see the selected field's data - effectively filtering to only that field and all it's data.
    Sorry if I wasn't clear - but thanks for the fast response!

  5. #5
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by dsharp
    Sortof - I forgot to mention that I've invoked the subform.form.recordsource property and assigned a sql string to it (too fast) but all the fields still show up with #name? in the data portion except the field I selected. while I do want that data displayed, the others now contain the #name error. I only want to see the selected field's data - effectively filtering to only that field and all it's data.
    Sorry if I wasn't clear - but thanks for the fast response!
    So, to clarify, you are trying to be able to see all of the data in all the table fields initially and then want to be able to see only a single fields data?

    You might want to create two subforms and alternately hide and show them. One could contain room for only one fields data and the other can have additional columns.

    Just a Friday evening thought.

    Gregg

Posting Permissions

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