Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Location
    Delaware
    Posts
    139

    Unanswered: Method or data member error

    Hello;

    I am getting a "Method or data member not found error when launching a form that has a control for getting and displaying the user. I copied and pasted the code from another file(s) (Access) on the same system, and am running the code on the same system. The one database runs the form fine, the second one throws the error. Would anyone know what might be the cause? (see graphic of error attached)

    Thanks...

    Larry
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    More importantly, we need to see the code for this. It running fine in one db and not in the other, on the same PC, plus the error (I couldn't open the attachment, so I'm going on your description) makes me wonder if your code calls a function that resides in a standard module (one you access from the Modules portion of the Access Objects Dialog Box) that is present in the original db but that you didn't copy into the new db.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Aug 2005
    Location
    Delaware
    Posts
    139
    MissingLinq;

    The code is posted below, however the graphic illistrates the availability of the associated Modules being present in the new database, as well as the error and the error line. Maybe I'm just too blinded by the copy-n-paste function, thinking it should be exact. Could anyone think of anything that could get lost in a copy-n-paste action that would cause the code not to execute?

    Larry

    -----------------------------------------------------------------

    Option Compare Database
    Option Explicit
    Function GetUser() As String
    '** Procedure to Get the User's Name from the Windows Login
    Dim si As SystemInfo
    Set si = New SystemInfo
    Dim strOut As String
    'strGetUser = si.UserName
    'strOut = si.UserName & " is logged into " & si.ComputerName
    GetUser = si.UserName
    If GetUser = "" Then
    MsgBox ("There is a problem with your Network Login Name!! Please contact your Network Administrator.")
    DoCmd.Quit
    End If
    End Function

  4. #4
    Join Date
    Aug 2005
    Location
    Delaware
    Posts
    139
    Opps... its this line that has the error:

    Option Compare Database
    Option Explicit
    Function GetUser() As String
    '** Procedure to Get the User's Name from the Windows Login
    Dim si As SystemInfo
    Set si = New SystemInfo
    Dim strOut As String
    'strGetUser = si.UserName
    'strOut = si.UserName & " is logged into " & si.ComputerName
    GetUser = si.UserName
    If GetUser = "" Then
    MsgBox ("There is a problem with your Network Login Name!! Please contact your Network Administrator.")
    DoCmd.Quit
    End If
    End Function

  5. #5
    Join Date
    Oct 2002
    Location
    Baghdad, Iraq
    Posts
    697
    Quote Originally Posted by Larryg
    MissingLinq;

    The code is posted below, however the graphic illistrates the availability of the associated Modules being present in the new database, as well as the error and the error line.
    But the modules might depend on references. So we need to see the code in the modules, and see what references you've got. (Tools, References...)

    VB probably isn't saying that SystemInfo.UserName is missing, it's probably saying that somewhere in that method there's another call that's failing.

    Maybe I'm just too blinded by the copy-n-paste function, thinking it should be exact. Could anyone think of anything that could get lost in a copy-n-paste action that would cause the code not to execute?
    Personally, I've never had code that I stole work without virtually rewriting it. By the way, the word "and" has three letters in it.
    Last edited by sco08y; 03-18-07 at 03:20.

  6. #6
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    What version of Access are we talking about here? When I try running this in Access 2000 it appears to think that SystemInfo is a user defined datatype that hasn't been defined.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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