Results 1 to 7 of 7
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    "Method or data member not found"

    A typical problem with Reports is a code reference to a field included in the ControlSource of a report but which DOES NOT have a corresponding bound control in the report design. The workaround for such cases is a simple bound control made non-visible. Like Me.MyField where MyField is the ControlSource of a non-visible text box.



    I have such a case where I have 5 non-visible text boxes bound to fields I make reference to in the reports code sheet, all 5 of those code references have been working for years. I just added a 6th text box bound to MyField but I'm still getting the error "Method or data member not found". I've run the ControlSource query independently to ensure that MyField is indeed returned by the query.

    Any suggestions?

    Thanks,
    Bill

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,915
    I know the issue and the solution, always worked for me. Maybe give the textbox a name different from the field it is bound to, like tbxMyField. That's what I always do. Then I reference the textbox name in expressions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    I'm baffled. I put the references in brackets and the errors went away, i.e., Me.[MyField]. What's baffling is that the none of the other 5 code references are coded with brackets.
    Bill

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,915
    Does the field name have spaces or special characters or is a reserved word like Date?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    No. One is "SatDinner" and another just added is "SundayBrunch". No blanks or special characters. I'll try your text box name approach shortly.

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Your text box name approach worked fine. E.g., Me.tbSatDinner blah blah blah where the tb is bound to SatDinner.

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Go figure............ text box name = Text6; Bound to FmType; code reference is Me.FmType. No problem!!! (No other controls bound to that field.)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. compile error method or data member not found???
    By chuman vishal in forum Programming
    Replies: 2
    Last Post: 02-26-2013, 01:57 PM
  2. Method or data member not found
    By papa yaw in forum Programming
    Replies: 5
    Last Post: 12-17-2012, 02:19 PM
  3. Compiler error: Method or member not found
    By JosmithTwo in forum Programming
    Replies: 3
    Last Post: 11-26-2012, 07:10 AM
  4. Replies: 7
    Last Post: 06-08-2012, 09:55 PM
  5. Compile Error: Method or data member not found
    By subtilty in forum Programming
    Replies: 5
    Last Post: 02-09-2012, 07:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums