+ Reply to Thread
Results 1 to 8 of 8

Compile Error: Method or data member not found when i click Save button...

Hybrid View

  1. #1
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Compile Error: Method or data member not found when i click Save button...

    untested but replace all of your form code by this
    Private Sub CBOCancel_Click()
       Unload Me
    End Sub
    Private Sub CBOClear_Click()
    
       Call UserForm_Initialize
    
    End Sub
    Private Sub CBOSave_Click()
       Dim RowCount               As Long
       Dim lCol                   As Long
    
       'Validasi Data
       If CBOJenis.Value = "" Then
          CBOJenis.SetFocus
          MsgBox "Jenisnya dipilih dong!", vbExclamation, "Data Entry Jenis"
          Exit Sub
       End If
    
       If CBOTipe.Value = "" Then
          CBOTipe.SetFocus
          MsgBox "Tipenya dipilih dong", vbExclamation, "Data Entry Tipe"
          Exit Sub
       End If
    
       If TXTDesk.Value = "" Then
          TXTDesk.SetFocus
          MsgBox "Deskripsi nya apa?", vbExclamation, "Data Entry Deskripsi"
          Exit Sub
       End If
    
       If CBOBulan.Value = "" Then
          CBOBulan.SetFocus
          MsgBox "Bulannya dipilih dong", vbExclamation, "Data Entry Bulan"
          Exit Sub
       End If
    
       If TXTJumlah.Value = "" Then
          TXTJumlah.SetFocus
          MsgBox "Jumlahnya diisi dong", vbExclamation, "Data Entry Jumlah"
          Exit Sub
       End If
    
       If Not IsNumeric(TXTJumlah.Value) = "" Then
          TXTJumlah.SetFocus
          MsgBox "Isi nya pake Angka ya!", vbExclamation, "Data Entry Jumlah"
          Exit Sub
       End If
    
       'Input data ke worksheet :p
       With Worksheets("EXPENSES")
          If Len(.Range("A3").Value) > 0 Then
             RowCount = .Range("A2").End(xlDown).Row + 1
          Else
             RowCount = 3
          End If
          .Cells(RowCount, "A").Resize(1, 3).Value = Array(CBOJenis.Value, CBOTipe.Value, TXTBOXDesk.Value)
    
          ' listindex starts at 0, output column starts in column 4/D so add index to 4 to get correct column for month
          lCol = 4 + CBOBulan.ListIndex
          .Cells(RowCount, lCol).Value = TXTBOXJumlah.Value
       End With
    
    End Sub
    Private Sub UserForm_Initialize()
       Dim ws                     As Worksheet
       
       Set ws = Worksheets("LookupLists")
    
       Me.CBOBulan.List = ws.Range("BulanList").Resize(, 2).Value
       Me.CBOJenis.List = ws.Range("JenisList").Resize(, 2).Value
       Me.CBOTipe.List = ws.Range("TipeList").Resize(, 2).Value
    
       TXTBOXDesk.Value = ""
       TXTBOXJumlah.Value = ""
       CBOJenis.SetFocus
    
    End Sub
    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
       If CloseMode = vbFormControlMenu Then
          Cancel = True
          MsgBox "Nutup nya pencet Cancel ya!"
       End If
    End Sub
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  2. #2
    Registered User
    Join Date
    12-30-2012
    Location
    Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Compile Error: Method or data member not found when i click Save button...

    yes JosephP. With your tweak, i finally got the ideas.... thank you very much for your time and effort....

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Error Msg: "Compile error: Method or data member not found" in VBA code
    By nenadmail in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2012, 02:12 AM
  2. [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
  3. 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
  4. Compile Error:Method or Data Member Not Found
    By loknath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-29-2012, 04:03 AM
  5. [SOLVED] Compile Error Method or data member not found
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2005, 06:05 PM

Tags for this Thread

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