Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Active Table (Access 2002)

    What is the Access table equivalent to ActiveDocument in Word?

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

    Re: Active Table (Access 2002)

    There is not one exact equivalent, but the Screen object has some properties that are comparable:

    Screen.ActiveDatasheet returns an object that represents the table or query that has the focus. (This is the one you need, probably)
    Screen.ActiveForm returns an object that represents the form that has the focus
    Screen.ActiveReport returns an object that represents the report that has the focus.
    Screen.ActiveDataAccessPage returns an object that represents the data access page that has the focus.

    Each of these returns an error if there is no object of the corresponding type that has the focus.

  3. #3
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Table (Access 2002)

    Thanks, but this doesn't seem to accomplish what I wanted (you'll have to excuse me, I'm kind of new to VBA).

    I have a working function in which I set a recordset object to the table whose data I want to manipulate. I would like to be able to run the function on whatever table I happen to be working on at the moment, instead of having to specify a table name in the VBA editor. The Screen.ActiveDatasheet object only seems to have a few methods, such as copy or requery. I need to be able to move through and edit the data. What is the correct way to do what I want?

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

    Re: Active Table (Access 2002)

    Screen.ActiveDatasheet.Name gives you the name of the table (or query) that has the focus.
    Screen.ActiveDatasheet.Recordset returms the recordset object belonging to the active table (or query)

  5. #5
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Table (Access 2002)

    Thanks, got it. Having no prior coding training, I'm having some trouble learning the landscape. [img]/forums/images/smilies/smile.gif[/img]

Posting Permissions

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