Results 1 to 3 of 3

Thread: RecordSource

  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: RecordSource

    I have a main form - frmExtendedSearch. Within that form I have an unbound subform setup called fsubSearchResults. I want to use this unbound fsub to display different searches from different forms. So, I have 3 other fsubs called A, B, and C. For A, B, and C, I need to be able to change their RecordSource. Normally this is easily done with A.RecordSource = "queryname". However, when I set the SourceObject of fsubSearchResults to either A, B, or C, how can I then set the RecordSource for A, B, or C? Thsi is what I currently have (which doesn't work):

    frmExtendedSearch!fsubSearchResults.SourceObject = "A"
    frmExtendedSearch!fsubSearchResults!A.RecordSource = "queryname"

    Any help much appreciated.

  2. #2
    Join Date
    Dec 2002
    Posts
    60

    Re: RecordSource

    Try:

    Forms!frmExtendedSearch!subformobjectname.Form.Rec ordSource="queryname"

    or if the code is located in frmExtendedSearch's module:

    me.subformobjectname.Form.RecordSource="queryname"

    where: subformobjectname is the name of the object that contains the subform (not the name of the sub form)

  3. #3
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    Thanks for the reply. I actually found another way of doing it, but I'll give yours a try too.

Posting Permissions

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