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

    Set grp to Nothing (Access 2003 SP2)

    In the following code do i need to set grp to Nothing at the end of the routine?

    Dim ws As Workspace, grp As Group, sUserName As String
    Set ws = DBEngine.Workspaces(0)
    Set grp = ws.Groups(sGroup)
    On Error Resume Next
    sUserName = ws.Groups(sGroup).Users(sUser).Name
    FindIfUserIsInGroup = (Err = 0)
    Set ws = Nothing

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

    Re: Set grp to Nothing (Access 2003 SP2)

    Yes. It is good practice to set all object variables to Nothing when you're done with them. Object variables are the ones you assign a value with Set:

    Set variable = value

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

    Re: Set grp to Nothing (Access 2003 SP2)

    Thank you Hans.

Posting Permissions

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