//SQL statement
SELECT * FROM Input_BMB WHERE Input_BMB.Tanggal AND
(Input_BMB.Tanggal >= ?) AND (Input_BMB.Tanggal <= ?)
ORDER BY Kode_Barang
//code
Private Sub cmdTampil_Click()
Dim periode As String
SQL = ""
SQL = " SELECT * FROM Input_BMB" _
& " WHERE Input_BMB.Kode_Barang" _
& " AND Input_BMB.Tanggal >= #" & CDate(TglA.Value) & "#" _
& " AND Input_BMB.Tanggal <= #" & CDate(TglB.Value) & "# " _
& " ORDER BY Input_BMB.Tanggal, Input_BMB.Nama_Barang"
Set rsTampil = New ADODB.Recordset
Set rsTampil = konekDb.Execute(SQL)
periode = Format(TglA.Value, "dd MMMM yyyy") & " S/D " & Format(TglB.Value, "dd MMMM yyyy")
If rsTampil.BOF Then
MsgBox "Barang BMB dengan periode tanggal " _
& Format(TglA.Value, "dd MMMM yyyy") & " S/D " _
& Format(TglB.Value, "dd MMMM yyyy") & " tidak ada !", _
vbInformation + vbOKOnly, "Informasi"
Else
On Error Resume Next
deKoneksi.Input_BMB (Format(TglA.Value, "dd/MM/yyyy")), (Format(TglB.Value, "dd/MM/yyyy"))
With rptLapBMB
.Sections("Section4").Controls("LblPeriode").Caption = Format(TglA.Value, "dd MMMM yyyy") & " S/D " & Format(TglB.Value, "dd MMMM yyyy")
.Sections("Section4").Controls("LblTgl").Caption = Format(Date, "dd MMMM yyyy")
.Refresh
.WindowState = 2
.Show 1
End With
End If
End Sub
Tidak ada komentar:
Posting Komentar
hay friend... sebelum exit, jgn lupa tinggalkan comment dulu ya...
kalau mau bertanya bisa tulis komentar atau email/fb ke: aranama@ymail.com
thank you...