Results 1 to 5 of 5

Compile error: Member already exists in an object module...Trying to create a form

Threaded View

  1. #1
    Registered User
    Join Date
    03-11-2015
    Location
    Champaign, IL
    MS-Off Ver
    2010
    Posts
    2

    Compile error: Member already exists in an object module...Trying to create a form

    Hello all,

    I am trying to create a form to add new customers to a database for my homework assignment. I keep getting the compile error: member already exists in an object module from which this object module derives.

    My codes are as follows:
    Form:
    Private Sub cmdOK()
        'Copy input values to sheet.
        Dim lRow As Long
        Dim ws As Worksheet
        Set ws = Worksheets("Customer Database")
        lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
        With ws
            .Cells(lRow, 1).Value = Me.Company_Name.Value
            .Cells(lRow, 2).Value = Me.Last_Name.Value
            .Cells(lRow, 3).Value = Me.First_Name.Value
            .Cells(lRow, 4).Value = Me.Address1.Value
            .Cells(lRow, 5).Value = Me.Address2.Value
            .Cells(lRow, 6).Value = Me.City.Value
            .Cells(lRow, 7).Value = Me.State.Value
            .Cells(lRow, 8).Value = Me.Zip_Code.Value
        End With
        
        'Clear input controls.
        Me.Company_Name.Value = ""
        Me.Last_Name.Value = ""
        Me.First_Name.Value = ""
        Me.Address1.Value = ""
        Me.Address2.Value = ""
        Me.City.Value = ""
        Me.State.Value = ""
        Me.Zip_Code.Value = ""
    End Sub
    
    Private Sub cmdCancel()
        'Close UserForm.
        Unload Me
    
    End Sub
    
    Private Sub UserForm_Click()
    
    End Sub
    And Module:
    Sub Customer_Database()
    '
    ' Customer_Database Macro
    ' Go to Customer Database Page
    '
    
    '
        Sheets("Customer Database").Select
        Range("Table1[Company Name]").Select
    End Sub
    Sub Vendor_Database()
    '
    ' Vendor_Database Macro
    ' Go to Vendor Database
    '
    
    '
        Sheets("Vendor Database").Select
        Range("B3").Select
    End Sub
    Sub Main_Menu()
    '
    ' Main_Menu Macro
    ' Return to Main Menu
    '
    
    '
        Sheets("Main Menu").Select
        Range("A1").Select
    End Sub
    Sub ShowCustomer()
        'Display Customer UserForm.
        ufrmCustomers.Show Modal
    End Sub

    What am I doing wrong?

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 03-11-2015 at 10:16 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Member already exists in an object module form which this object module derives error
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2014, 03:14 AM
  2. [SOLVED] Compile Error in Hidden Module and Compile Error: Can't find project or library
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-10-2013, 07:03 PM
  3. [SOLVED] Compile error: Method or data member not found.
    By ndtsteve in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2012, 11:31 AM
  4. Compile Error: Method of data member not found (VBA)
    By vbatech in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 03-14-2012, 05:37 PM
  5. Replies: 3
    Last Post: 10-25-2011, 02:12 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1