manfaatkan hidden form atau form biasa yang mengontrol open close report yang dimaksud.
saya simulasi di tempat saya, menampilkan daftar customer by their city.
city saya kumpulkan di listbox, form dipasang timer untuk menggerakkan cursor di listbox tiap 5 detik pindah satu baris kebawah.
setiap perpindahan cursor, report di 'refresh'.
codenya seperti ini, tanpa melihat access db nya, saya yakin anda bisa memetik.
Option Explicit Dim countCity As Integer ' total jumlah kota dalam listbox Dim curCityIndex As Integer ' indeks yang ditunjuk saat ini Private Sub Form_Open(Cancel As Integer) Me.List0.Selected(0) = True 'tunjuk awal indeks list box countCity = Me.List0.ListCount 'simpan total kota Me.TimerInterval = 5000 'set form timer ke 5 detik End Sub Private Sub Form_Timer() 'majukan indeks listbox setiap kali timer ke-triger If (curCityIndex + 1) > countCity Then curCityIndex = 0 Else curCityIndex = curCityIndex + 1 End If Me.List0.Selected(curCityIndex) = True 'Refresh Report dengan mengubah model viewnya DoCmd.Echo False DoCmd.OpenReport "Query1", acViewPreview DoCmd.OpenReport "Query1", acViewReport DoCmd.Echo True End Sub
regards,
a.k.
Terima kasih mas MBA,
Kalo tutup trus buka lagi gitu nggak praktis mas, karena komputer yang ini langsung berhadapan dengan client jadi jauh dari back office.
Atau mungkin ada VBA yang bisa memerintahkan report close dan kemudian open lagi setelah interval waktu tertentu?
Regrads,
Endro
Posted by: Aksan Kurdin <aksan.kurdin@gmail.com>
| Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (6) |
Tidak ada komentar:
Posting Komentar