Results 1 to 2 of 2
  1. #1
    Kananelo is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    7

    Question what causes "sub or function not defined error"? how do i fix it?

    Folks, i need help with the following code, i have a form that collects data and is supposed process that data, after collecting data, i have a button that says "create Notes" much like 'Create Invoice' with the following code:



    Code:
    Private Sub cmdCreatePr_Notes_Click()
        Dim ReferralID As Long
        Dim ProcessID As Long
        
        ReferralID = Nz(Me![Referral ID], 0)
        
        ' Gracefully exit if Process Notes already created
        If ReferralDetails.IsProcessed(ReferralID) Then
            If MsgBoxYesNo(ReferralAlreadyProcessed) Then
                ReferralDetails.PrintReferralConfirmation ReferralID
            End If
        ElseIf ValidateReferral(Processed_ReferralDetails) Then
             
            ' Create Referral Record
            If ReferralDetails.CreateConfirmation(ReferralID, 0, ProcessID) Then
                
                ' Mark all Referrals Referred
                ' Need to change Status to REFERRED from PENDING
                Dim rsw As New RecordsetWrapper
                With rsw.GetRecordsetClone(Me.sbfReferralDetails.Form.Recordset)
                    While Not .EOF
                        If Not IsNull(![Registry ID]) And ![Status ID] = Pending_ReferralStatus Then
                            rsw.Edit
                            ![Status ID] = Processed_ReferralStatus
                            rsw.Update
                            Registry.PendingToReferred ![Registry ID]
                        End If
                        rsw.MoveNext
                    Wend
                End With
                
                ' Print the PrintConfirmation
                ReferralDetails.PrintReferralConfirmation ReferralID
                 
                SetFormState
            End If
        End If
    End Sub
    End Sub
    But i get an error message that reads "Sub or Function not defined"
    can anybody help please...

  2. #2
    thhui is offline Competent Performer
    Windows XP Access 2002
    Join Date
    Feb 2009
    Posts
    235
    Delete one of the End Sub at the end.

    See whether it works!

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

Similar Threads

  1. Access 2003 Date() Function returns "#Name?"
    By smartel@soprema.ca in forum Programming
    Replies: 5
    Last Post: 01-18-2012, 05:52 AM
  2. Replies: 3
    Last Post: 04-10-2010, 10:22 AM
  3. Replies: 4
    Last Post: 02-11-2010, 02:21 AM
  4. "Too many fields defined" error
    By Matthieu in forum Queries
    Replies: 1
    Last Post: 01-28-2010, 08:55 PM
  5. Error: "User-defined type not defined"
    By mastromb in forum Programming
    Replies: 10
    Last Post: 01-08-2010, 02:57 PM

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