ini saya copy paste dari vb.

Private Sub CMDSAVE_Click()
    If cmbcurrency.Text = "IDR" Then
        Call IDR
        Else
        Call usd
        End If
        Adodc1.Refresh
        DG1.Refresh
End Sub
Private Sub Form_Load()
    strcon = "provider=microsoft.jet.oledb.4.0;data source=c:\trs\vendor.mdb"
    Set cn = New ADODB.Connection
    cn.ConnectionString = strcon
    cn.Open
    
End Sub
Sub IDR()
    Dim sqlidr As String
    sqlidr = "insert into vendor 
(NOID,VENDOR,NOINVOICE,PEKERJAAN,INVOICEDATE,RECDATE,DUEDATE,INVOICE,IDR,TOTAL)values"
 & _
    "('" & txtid.Text & "','" & txtvendor.Text & "','" & txtnoinvoice.Text & 
"','" & txtpekerjaan.Text & "'," & _
    "'" & txtinvoicedate.Text & "','" & txtrecdate.Text & "','" & 
txtduedate.Text & "','" & Val(txtinvoice.Text) & "'," & _
    "'" & cmbcurrency.Text & "','" & Val(txttotal.Text) & "')"
    cn.Execute (sqlidr)
    
End Sub
Sub usd()
    Dim sqlusd As String
    sqlusd = "insert into vendor 
(NOID,VENDOR,NOINVOICE,PEKERJAAN,INVOICEDATE,RECDATE,DUEDATE,INVOICE,USD,TOTAL)values"
 & _
    "('" & txtid.Text & "','" & txtvendor.Text & "','" & txtnoinvoice.Text & 
"','" & txtpekerjaan.Text & "'," & _
    "'" & txtinvoicedate.Text & "','" & txtrecdate.Text & "','" & 
txtduedate.Text & "','" & Val(txtinvoice.Text) & "'," & _
    "'" & cmbcurrency.Text & "','" & Val(txttotal.Text) & "')"
    cn.Execute (sqlusd)
End Sub


       
____________________________________________________________________________________
Sick sense of humor? Visit Yahoo! TV's 
Comedy with an Edge to see what's on, when. 
http://tv.yahoo.com/collections/222

[Non-text portions of this message have been removed]

Kirim email ke