Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 7

Option Compare Database

Private Sub dt_KeyPress(KeyAscii As Integer)

On Error Resume Next

If KeyAscii = 13 Then

st.SetFocus

End If

End Sub

Private Sub Form_Error(DataErr As Integer, Response As Integer)

On Error Resume Next

If DataErr = 7787 Then

Response = acDataErrContinue

Me.Recordset.MovePrevious

Me.Recordset.MoveNext

End If

End Sub

Private Sub Form_Load()

'MsgBox Me.Caption

End Sub

Private Sub st_KeyPress(KeyAscii As Integer)

On Error Resume Next

If KeyAscii = 13 Then
tampilkan.SetFocus

End If

End Sub

Private Sub tampilkan_Click()

On Error Resume Next

DoCmd.SetWarnings False

DoCmd.RunSQL "update perbulan set dt = '" & dt & "', st = '" & st & "'"

If Form_pertanggal.Caption = "Cetak outbound Pertanggal" Then

DoCmd.OpenReport "invoice_outbound_pertanggal", acPreview

ElseIf Form_pertanggal.Caption = "Cetak Inbound Pertanggal" Then

DoCmd.OpenReport "invoice_inbound_pertanggal", acPreview

ElseIf Form_pertanggal.Caption = "cetak no faktur inbound pertanggal" Then

DoCmd.OpenReport "invoice_inbound_pertanggal_with_no_faktur", acPreview

ElseIf Form_pertanggal.Caption = "Cetak City Courier Pertanggal" Then


DoCmd.OpenReport "invoice_city_courier_pertanggal", acPreview

ElseIf Form_pertanggal.Caption = "Cetak Pribadi Pertanggal" Then

DoCmd.OpenReport "invoice_pribadi_pertanggal", acPreview

ElseIf Form_pertanggal.Caption = "Cetak Cod Pertanggal" Then

DoCmd.OpenReport "invoice_cod_pertanggal", acPreview

ElseIf Form_pertanggal.Caption = "Cetak Cash Sales Pertanggal" Then

DoCmd.OpenReport "invoice_cash_sales_pertanggal", acPreview

Else

DoCmd.OpenForm "pemecah_invoice"

Form_pemecah_invoice.Caption = Form_pertanggal.Caption

'msgbox caption

DoCmd.Close acForm, "pertanggal"

Form_pemecah_invoice.Caption = Form_pertanggal.Caption
If Form_pertanggal.Caption = "outbound Pertanggal" Or Form_pertanggal.Caption = "outbound
Perawb Pertanggal" Or Form_pertanggal.Caption = "outbound Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_outbound!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_outbound!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With

ElseIf Form_pertanggal.Caption = "Inbound Pertanggal" Or Form_pertanggal.Caption = "Inbound


Perawb Pertanggal" Or Form_pertanggal.Caption = "Inbound Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_inbound!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_inbound!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With
ElseIf Form_pertanggal.Caption = "City Courier Pertanggal" Or Form_pertanggal.Caption = "City
Courier Perawb Pertanggal" Or Form_pertanggal.Caption = "City Courier Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_city_courier!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_city_courier!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With

ElseIf Form_pertanggal.Caption = "Pribadi Pertanggal" Or Form_pertanggal.Caption = "Pribadi Perawb


Pertanggal" Or Form_pertanggal.Caption = "Pribadi Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_pribadi!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_pribadi!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With
ElseIf Form_pertanggal.Caption = "COD Pertanggal" Or Form_pertanggal.Caption = "COD Perawb
Pertanggal" Or Form_pertanggal.Caption = "COD Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_cod!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_cod!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With

ElseIf Form_pertanggal.Caption = "Cash Sales Pertanggal" Or Form_pertanggal.Caption = "Cash Sales


Perawb Pertanggal" Or Form_pertanggal.Caption = "Cash Sales Perkode Pertanggal" Then

With Form_pemecah_invoice

.awalan = Left(Forms!invoice_cash_sales!no_invoice, 4) & "-"

.akhiran = Mid(Forms!invoice_cash_sales!no_invoice, 5, 255)

.no_invoice_pecahan.SetFocus

End With
End If

End If

End Sub

You might also like