Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    6

    Unanswered: row-level access during subform query

    hi there.
    i have a multi-row datasheet subform used for editing that needs to have a bit of historical information per row (pulled from other tables).
    i have a tried a couple of different approaches:
    one of them was to have the subform pull from a single query but the historical information would require the use of Left Joins and then the subform cannot be updated.

    so... another approach i am now considering is when the subform is loaded (linked to the primary form), if i can gain access to each row in the subform as it is loading (or after it has loaded), i can manually query the historical information and set the subform labels myself.
    any idea on which side (form or subform) to start and which events to utilize?
    or, if you know of a better approach, please shoot.
    thanks

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

    Re: row-level access during subform query

    Originally posted by madmarcos
    hi there.
    i have a multi-row datasheet subform used for editing that needs to have a bit of historical information per row (pulled from other tables).
    i have a tried a couple of different approaches:
    one of them was to have the subform pull from a single query but the historical information would require the use of Left Joins and then the subform cannot be updated.

    so... another approach i am now considering is when the subform is loaded (linked to the primary form), if i can gain access to each row in the subform as it is loading (or after it has loaded), i can manually query the historical information and set the subform labels myself.
    any idea on which side (form or subform) to start and which events to utilize?
    or, if you know of a better approach, please shoot.
    thanks
    Where are you gonna store this "historical" info? As part of the record? In a related table?

  3. #3
    Join Date
    Jan 2004
    Posts
    6
    let me try to better describe what the user wants:

    the primary form has customer information
    the subform has a week #, year, and # of calls for the specified week (editable).
    the user would like to have, for a given week # and year, the # of calls placed the week prior and 2 weeks prior (display only), next to the editable # of calls for that week.

    i went ahead and implemented a crappy solution of adding 2 fields (priorweek1 and priorweek2 to store the # of calls in weeks prior to the week/year of that record) to my calls table and every time the user changes the viewed week/year it recalcs and updates the priorweek1 and priorweek2 fields of the viewed current week/year and displays them in the subform.
    not great but i needed to get something working.

  4. #4
    Join Date
    Jan 2004
    Posts
    6
    a better solution is to not have fields that are used to store information that is already in the table and can be accessed via query.
    but the problem is the single query that can pull that data correctly involves left joins and that makes the resulting recordset non-updateable.

    so, i was wondering if there was some event that is fired for each record that is fetched from the database when the subform's query runs?

Posting Permissions

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