Results 1 to 2 of 2
  1. #1
    junwatts is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    1

    Method or Data member not found error

    I'm a newbie trying to upgrade a 2003 database to 2010. When I compile this database an error pops up saying "Method or data member not found". This is the code below:


    Private Sub CBPrintReq_Click()
    On Error GoTo SendPrintError
    Dim NewID As String, Notice As String, Temp
    Dim CRLF As String * 3

    CRLF = Chr$(10) + Chr$(13)
    Notice = ""
    Notice = Notice + "You are requesting to print the request Instead of "
    Notice = Notice + "sending it to the Systems staff. Please note that "
    Notice = Notice + "if you wish to continue with this request, you will "
    Notice = Notice + "need to obtain your manager's signature on the "
    Notice = Notice + "printout, and turn the request into systems. " + CRLF
    Notice = Notice + "Do you still wish to print out this request? "
    If MsgBox(Notice, 4 + 48 + 256, "Print Request") = 6 Then
    'Check for valid fields
    If CheckReq() Then
    'Add the request to the database
    NewID = FileReq(1)

    'Print Request


    If PrintReq(NewID) Then
    MsgBox "Your Request has been printed. Please have your request" + CRLF + "signed by your manager, then deliver it to the Systems staff inbox." + CRLF + "Your Request ID Number is: " & NewID

    'Update Ini File
    SaveSetting "TSystems", "WorkRequest", "LastRequester", Me.Requester
    SaveSetting "TSystems", "WorkRequest", "LastID", NewID

    'Close the form and return to the Main Menu
    DoCmd.Close
    End If
    End If
    End If
    SendPrintExit:
    Exit Sub
    SendPrintError:
    MsgBox "A critical error has occurred. Please notify Systems at 3-0970 immediately." + Chr$(10) + Chr$(13) + "Error identifier: WorkReq.CBPrintReq_Click"
    MsgBox Error$
    Resume SendPrintExit
    End Sub


    Can anyone please help with this. Thanks!!

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742

    some quick feedback

    1) Put Option Explicit at the top of the module.

    2) Locate the functions "CheckReq()" and "FileReq()" and the procedure "SaveSetting". They would be my first guesses at what Access can't find. (Probably the answer to your technical question.)

    3) For CRLF, you can use the constant vbCRLF.

    4) For string concatenation, it's a better habit to use the & operator rather than the + operator. It's less ambiguous to read when using two variables next to each other.

    5) the line continuation character (_) is your friend for making code like this most readable.

    Code:
    Option Explicit
    Private Sub CBPrintReq_Click()
    On Error GoTo SendPrintError
    Dim NewID As String 
    Dim Notice As String 
    Dim Temp
    Notice = "You are requesting to print the request Instead of " & _
             "sending it to the Systems staff. Please note that " & _ 
             "if you wish to continue with this request, you will " & _ 
             "need to obtain your manager's signature on the " & _ 
             "printout, and turn the request into systems. " & vbCRLF & _ 
             "Do you still wish to print out this request? " & _ 
    If MsgBox(Notice, 4 + 48 + 256, "Print Request") = 6 Then
       'Check for valid fields
       If CheckReq() Then
          'Add the request to the database
          NewID = FileReq(1)
          'Print Request
          If PrintReq(NewID) Then
             MsgBox "Your Request has been printed. Please have your request" & vbCRLF & _ 
                     "signed by your manager, then deliver it to the Systems staff inbox." & vbCRLF  & _ 
                     "Your Request ID Number is: " & NewID
             'Update Ini File
             SaveSetting "TSystems", "WorkRequest", "LastRequester", Me.Requester
             SaveSetting "TSystems", "WorkRequest", "LastID", NewID
             'Close the form and return to the Main Menu
             DoCmd.Close
          End If
       End If
    End If
    SendPrintExit:
    Exit Sub
    SendPrintError:
       MsgBox "A critical error has occurred. "  & _
              "Please notify Systems at 3-0970 immediately." & vbCRLF & _
              "Error identifier: WorkReq.CBPrintReq_Click"
       MsgBox Error$
       Resume SendPrintExit
    End Sub

    NOTE - if you put the word CODE in square brackets [] before your code, and /code after, then the forum will preserve your formatting.

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