Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002

    Unanswered: change a form record source temporarily

    I have created a Database using Microsoft Access 2000.

    I have a form called [aStaffTrainingUpdateIndividuallyF]

    This form has a query record source called [aStaffTrainingLimitedQ]
    This query refers to a table called [StaffTraining]

    The query has a field in it called [TrainingStage] (one of many fields).
    The criteria for this field is <>"Completed Training" And <>"Pre Employment Training"
    This limits the number of records viewed.

    I also have another query called [aStaffTrainingQ]
    This query has no limitations on the records viewed.

    I want to open my form called [aStaffTrainingUpdateIndividuallyF] so that it gives me only those records provided through the [aStaffTrainingLimitedQ] query.
    But I want the user to also be able to request (through the form) to view all records (with no limitations) as could be obtained using the [aStaffTrainingQ] query.

    I have thought about adding a button which closes this form and opens the another form which uses the [aStaffTrainingQ] query. But I do not know if there is a better way of doing this.

    I have also thought of writing some code (using event procedure) that changes the form record source (temporarily) as I would always want the form to open using the [aStaffTrainingLimitedQ] query (as a default). I have played around with some code but nothing seems to work for me.

    Can you give me some advise and/or help me with the appropriate code?

    Thanks heaps

  2. #2
    Join Date
    Apr 2004
    metro Detroit
    Set the record source to the non-filtered query and handle the filtering on the form. Look up filter and showallrecords in Access help.

  3. #3
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    or base the form on the unlimited query, and apply a filter as appropriate to limit or not limit.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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