Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Return 'This form' or 'This table' (2003)

    I now this is probably a F.A.Q.,but I'll be whipped if I can figure out anything even close to how to do this.

    How can I get the name of the current form, or the current table that's the record source of the form? I have several tables and forms that are almost excatly the same, and I'm trying to generalize some of the code behind the buttons.

    Thanks.

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Return 'This form' or 'This table' (2003)

    Why not just make a copy of the form and use it as a base form to make a copy from when you wish to make up a new form.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Return 'This form' or 'This table' (2003)

    Because that doesn't help me writing when writing and maintaining one function instead of multple functions for each different form and recordsource.

  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Return 'This form' or 'This table' (2003)

    Well then you could make up a Public function by putting it in the Modules as opposed to the form.

    The record source could be a query that can be used by multiple forms.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Return 'This form' or 'This table' (2003)

    It's not very clear what you want to do, but the active form is Screen.ActiveForm. Its recorrd source is Screen.ActiveForm.RecordSource.

  6. #6
    5 Star Lounger
    Join Date
    May 2003
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    629
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Return 'This form' or 'This table' (2003)

    Thanks! That's what I'm looking after.

Posting Permissions

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