Results 1 to 10 of 10
  1. #1
    Join Date
    May 2006
    Posts
    386

    Unanswered: Can any1 please help with this error "Compile Error"Method or data member not found ?

    Dear All,
    I have a database which is on 3 computers and they all work perfectly well. Same copy is on my computer and it also used to work perfectly well. For some strange reason when I tried to run one of the forms, it is giving me an error saying " Compile Error" Method or data member not found and it highlights this line of the code which is marked in BOLD, please also note that this is half the code, the rest of code is not pasted here.

    Private Sub Form_Current()

    Dim InterpreterID As Integer
    Dim strInterpreterName
    Dim intClientID, intLanguageID As Integer
    Dim strClientName, strLanguage As String
    Dim cur2ndHourNAsian As Currency

    On Error GoTo ErrH

    If Me.NewRecord = True Then
    ' YOu dont make a booknig with an idea
    DoCmd.GoToRecord , , acLast
    End If
    ' ClientID = Me.ClientID.Value
    ' Me.ClientName.Value = DLookup("Name", "Client", "id = " & ClientID)
    'Putting in the employees name
    InterpreterID = Me.InterpreterID.Value
    strInterpreterName = DLookup("FirstName", "Interpreter", "id = " & InterpreterID)
    strInterpreterName = strInterpreterName & " " & DLookup("SurName", "Interpreter", "id = " & InterpreterID)
    Me.InterpreterName.Value = strInterpreterName

    'putting the the language
    intLanguageID = Me.cboLanguage1ID.Value
    strLanguage = DLookup("Language", "Language", "id = " & intLanguageID)
    Me.txtLanguage.Value = strLanguage
    I actually re-copied the whole database from other computer and run it on my computer and strangely I got the same message.
    Any help would be much appreciated.
    Emi-UK
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Looks like a strange thing to error out on...

    Kneejerk reflex would be to check missing references. How do those look?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    May 2006
    Posts
    386
    I am sorry I didnt understand what you mean by " kneejerk reflex" If you mean whether there is anything marked as missing in the tools/Reference? then, No, there is nothign marked as missing and the references are exactly the same way as other databases.
    Emi-UK
    Love begets Love, Help Begets Help

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Quote Originally Posted by Emal
    I am sorry I didnt understand what you mean by " kneejerk reflex" If you mean whether there is anything marked as missing in the tools/Reference? then, No, there is nothign marked as missing and the references are exactly the same way as other databases.
    That just means it would be the first thing I would check.

    How about if you debug and step through the event. What is the value of Me.InterpreterID.Value at the time this line is being executed?

    Also, what kind of control is Me.InterpreterID?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    May 2006
    Posts
    386
    Ok, when I click on the form, I get that error " method or data member not found "
    What is the value of Me.InterpreterID.Value at the time this line is being executed?
    Well, this Me.InterpreterID.Value is supposed to bring up interpreter's name in an unbound comobox.

    InterpreterID is an aunbound comobox and it is supposed to bring up interpreters names. Also, when I click on the property of this unbound object, the row source of this property is
    SELECT Interpreter.id, Interpreter.FirstName, Interpreter.Surname FROM Interpreter ORDER BY Interpreter.FirstName;
    and there is nothing in the Control Source. Thanks
    Emi-UK
    Love begets Love, Help Begets Help

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Do you know how to debug and step through the code? If not, you REALLY should pick up this skill immediately, it will help you immensely with everything you do.

    If you do, please set a breakpoint at the beginning of your sub and step through the code up to JUST BEFORE the point where it breaks. Then use the intermediate window to check the value of your control with:

    ?Me.InterpreterID.Value

    Tell me what you get.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    May 2006
    Posts
    386
    I know how to Debug and run the "Compile" option and when i do run it it breaks on a different line. I know I am not very good when it comes to hard codings, I will really appreciate if you could kindly tell me the few steps that is required to set breakpoint and then step through the codes AND how do I really check te vale of the control with ?Me.InterprterID.Value

    Thanks for your help in advance.
    Emi-UK
    Love begets Love, Help Begets Help

  8. #8
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    If "Me" is the form and "InterpreterID" is a control, should it not read "Me!InterpreterID.Value. Alternatively, you could try
    Me.Controls("InterpreterID").Value. The point being (I think) that the Controls collection is a property of Me and consists of a set of pointers to child records which are children of Me (sort of).
    Have you changed your version of Access recently? I suspect that some versions of Access would allow multiple syntaxes, so long as the meaning was clear, but it may not be the case today.

  9. #9
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Couple of observations (none of which may be helpful)

    I'm a lazy programmer... I rarely use Me.ControlName.Value syntax when the code is part of the form's module. I just use variable=ControlName.
    I can see where that would lead to some confusion when you've declared a variable with the same name as a control. In your case, you would end up with InterpreterID=InterpreterID. hmmm...

    Also, you've said that the interpreterID is a name, while you've declared the variable as an integer.

    However, neither of these would cause the particular error that you're seeing.
    Inspiration Through Fermentation

  10. #10
    Join Date
    May 2006
    Posts
    386
    Dear Jim and RedNeckGeek,
    In response to your question Jim, " Me" is not a form and "InterpreterID" is name of a field from booking table that is related to interpreter's table to get interpreter's name when this "InterpreterID" is selected either in the form, queries or reports.
    I have not changed or converted version of my access and I am using ms access 2002.

    In response to your question RedNeckGeek, unfortunately I am not that good when it comes to hard coding but as I said in my previous replies, this very same DB is working perfectly well on other computers.

    Thank you all for your supports.
    Emi-UK
    Love begets Love, Help Begets Help

Posting Permissions

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