Results 1 to 7 of 7

Thread: Subform (97)

  1. #1
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform (97)

    I have a subform which displays multiple records (continuous). On this subform I also have a listbox for displaying data from another table, that is related to the records on the subform. I use a select statement that grabs data based on a field on the subform. This almost works (displays correct data for first detail record). My problem is that this listbox keeps repeating the data related to the first record on the subform. How can I get the listbox to refresh or requery for each detail record?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform (97)

    In the On Current event of the subform, enter
    Me.Mycombo.Requery
    Francois

  3. #3
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform (97)

    Francois, I tried your solution but it still repeats the data related to the first record. Maybe this isn't possible with continuous records??? My subform is named frmSubTwo, and it displays continuous records based on one query (works fine). This subform also has a list box named List99, which uses a select statement against a different table (but with a related field). As I mentioned before, the data displayed in this list box is correct for the first record, but this same data displays for all subsequent records on the subform. On the 'On current' event of the subform (frmSubTwo) I have the code: Me.List99.Requery
    Anything else I should try?

    Thanks for your help.

  4. #4
    Star Lounger
    Join Date
    Dec 2000
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform (97)

    I've had crazy problems like this in subforms with listboxes and comboboxes not being requeried even though I issue the requery method.

    One thing that worked for me was to programmatically set the RecordSource property for the form and/or RowSource property for the control AGAIN just BEFORE having the line of code doing the requery, i.e.,

    Me.List99.RowSource = "SELECT whatever, etc., etc."
    Me.List99.Requery

    Let me know if this works for you.

    Stephan

  5. #5
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform (97)

    Adding the Select statement before the requery almost worked. Now I still see the data related to the first record, in each list box, but if I click on any field for a particular detail record, all occurrences of the list box change to display the data related to the "clicked" record. This is better, but I was hoping to be able to automatically display data related to each record, right next to that particular record. Apparently the list box is only "pointing" to one piece of data at a time and just repeating itself for each of the continuous records on the form. This is not how I want this form to look. Any other ideas?????

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Subform (97)

    You can't avoid that behavior with a continuous form. Even though it looks like there is a set of controls for each record, there is really only one set so some actions will result in the same information being displayed in all rows. This is particularly true of unbound controls, since they can only be affected by the current record, which is the only one you can actually address.
    Charlotte

  7. #7
    New Lounger
    Join Date
    Mar 2002
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform (97)

    Thank you Charlotte and all the other great folks who participate in this wonderful forum.

Posting Permissions

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