//honeypot demagogic

 Forum DhammaCitta. Forum Diskusi Buddhis Indonesia

Author Topic: insert combobox to vb 6.0  (Read 2459 times)

0 Members and 1 Guest are viewing this topic.

Offline levi

  • Bukan Tamu
  • *
  • Posts: 4
  • Reputasi: 0
  • Semoga semua mahluk berbahagia
insert combobox to vb 6.0
« on: 01 March 2012, 10:42:46 AM »
gan ane ada masalah untuk insert combobox ke vb,ini scrip yg dah ane buat :

Private Function SaveAddBuss() As Boolean
    On Error GoTo SaveAddBuss_Error
    Dim ctl As Control
       
        SaveAddBuss = False
        For Each ctl In Me.Controls
             If TypeOf ctl Is TDBCombo Then
                If ctl.Text = "" Then ctl.BoundText = ""
             End If
        Next
       
        SaveAddBuss = ObjDBUMFBANK.Add(txt_leaseText, txt_lesse.Text, cbopay.BoundText, cbotype.ItemData, DTPicker3.Value, DTPicker1.Value, DTPicker2.Value, txt_tenor.Text, txt_pay.Text, txt_rental.Text, True, Database_Nm, ServerName)

        If Not SaveAddBuss Then
            MsgBox "Warning. The record was not Saved to the database.", vbCritical, MSGBOX_HDR & " - VALIDATION"
        End If

SaveAddBuss_Done:
  Screen.MousePointer = vbNormal
  Exit Function

SaveAddBuss_Error:
  Select Case Err.Number
    Case 13
      MsgBox "Invalid data. The data you are trying to save is invalid. Please make sure that all the data that you are entering is valid.", vbInformation, MSGBOX_HDR
      Resume SaveAddBuss_Done
  End Select
  Call Process_Error(MODULE_NAME, "SaveAddBuss")
  Resume SaveAddBuss_Done

End Function

pas ane run  gs bisa knp ya,trims..


Offline Mas Tidar

  • KalyanaMitta
  • *****
  • Posts: 3.262
  • Reputasi: 82
  • Gender: Male
Re: insert combobox to vb 6.0
« Reply #1 on: 01 March 2012, 11:33:12 AM »

coba membantu, mudah2an berkenan

kenapa On Error GoTo SaveAddBuss_Error diletakkan dibawah fucntion ?
On Error GoTo SaveAddBuss_Error dipindahkan dimana error akan terjadi (sbg trap error)




semoga berhasil
Saccena me samo natthi, Esa me saccaparamiti

"One who sees the Dhamma sees me. One who sees me sees the Dhamma." Buddha

Offline levi

  • Bukan Tamu
  • *
  • Posts: 4
  • Reputasi: 0
  • Semoga semua mahluk berbahagia
Re: insert combobox to vb 6.0
« Reply #2 on: 01 March 2012, 03:04:22 PM »
jadi diletakkan pas dmn??

Offline levi

  • Bukan Tamu
  • *
  • Posts: 4
  • Reputasi: 0
  • Semoga semua mahluk berbahagia
Re: insert combobox to vb 6.0
« Reply #3 on: 01 March 2012, 03:07:44 PM »
dh ane letakkin di bawah  SaveAddBuss = ObjDBUMFBANK.Add(txt_lease.Text, txt_lesse.Text, cbopay.BoundText, cbotype.Text, DTPicker3.Value, DTPicker1.Value, DTPicker2.Value, txt_tenor.Text, txt_pay.Text, txt_rental.Text, True, Database_Nm, ServerName)

tp msh error " object required"

gmn????

Offline Mas Tidar

  • KalyanaMitta
  • *****
  • Posts: 3.262
  • Reputasi: 82
  • Gender: Male
Re: insert combobox to vb 6.0
« Reply #4 on: 01 March 2012, 03:11:09 PM »
diletakkan ditempat yang paling cocok.

misal didalam if ... then ... end if
atau select case-nya tidak representatif dengan error yang diharapkan


kalau perlu didebug, kenapa sampai nggak jalan (F8 / F9, sy sdh meninggalkan vb)
Saccena me samo natthi, Esa me saccaparamiti

"One who sees the Dhamma sees me. One who sees me sees the Dhamma." Buddha

Offline Mas Tidar

  • KalyanaMitta
  • *****
  • Posts: 3.262
  • Reputasi: 82
  • Gender: Male
Re: insert combobox to vb 6.0
« Reply #5 on: 01 March 2012, 03:20:17 PM »
dh ane letakkin di bawah  SaveAddBuss = ObjDBUMFBANK.Add(txt_lease.Text, txt_lesse.Text, cbopay.BoundText, cbotype.Text, DTPicker3.Value, DTPicker1.Value, DTPicker2.Value, txt_tenor.Text, txt_pay.Text, txt_rental.Text, True, Database_Nm, ServerName)

tp msh error "object required"

gmn????

berarti ada object yang dipanggil tp tidak didefinisikan
Saccena me samo natthi, Esa me saccaparamiti

"One who sees the Dhamma sees me. One who sees me sees the Dhamma." Buddha

Offline levi

  • Bukan Tamu
  • *
  • Posts: 4
  • Reputasi: 0
  • Semoga semua mahluk berbahagia
Re: insert combobox to vb 6.0
« Reply #6 on: 01 March 2012, 03:22:36 PM »
jd gmn gan??