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..
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
jadi diletakkan pas dmn??
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????
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)
Quote from: levi 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????
berarti ada object yang dipanggil tp tidak didefinisikan
jd gmn gan??