Kudu harus bikin additional function yak . 

 

Thanks advicenya mbah kong, udah jadi kalau pake additional function atau
additional query . makasih juga mas Ivan.

Asli database nya di bikin oleh rekan kantor dr Bangkok.

Connection lewat odbc ke ms sql.

 

Reports nya untuk berbagai macam laporan hanya ada 2 yakni unbound report
standard ukuran A4 and A3 (satu report berisi +/- 30 unbound objects).

Semua objects properties di reports atau di form harus di set lewat table.
Nah kebetulan semua properties dasar seperti filter, group, width, length
dll udha di keluarin jadi field di table.

Tapi properties RecordSource nya ga dikeluarkan sama dia . jadi "resminya"
cuma bisa maen di "filter" properties yang udah dia keluarin lewat table
settingan (BT ya)

 

Cool sih . tapi ribet ngikutin cara pikirnya. Rhepot. Apalagi table nya cuma
satu . semua info di dumped dia ke satu table makanya aseli tablenya field
nya sampe lebih dari 50 biji (moga2 mbah Bud ga baca, ntar koar koar masalah
normalisasi lagi!)

 

Susah susah ... Tapi beneran keren, niat tuh org . object2 di reports nya di
konfigurasi tanpa lewat design view. Cuma sayang udah MDE ..hehehe bete 

 

Anyway thanks yooooooo

 

Moed

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED]
On Behalf Of aksan kurdin
Sent: Tuesday, 24 June, 2008 7:13 PM
To: [email protected]
Subject: Re: [belajar-access] Nyari top 3 by specific group

 

Moed,
Karena Access gak ada store procedure, jadi kita simulasikan store
procedurenya lewat vba.
saya bikin temp. table zTable1 yang sama persis strukturnya dengan Table1
(nama saya ganti, bikinnya buru-buru :) )
lalu zTable1 saya buatkan form datasheet untuk melihat hasilnya.
di setiap kali buka form, ztable1 selalu dipaksa untuk mengupdate, mengambil
dari table1 3 baris pertama setiap departemen.

code behind form form1:

Option Compare Database
Option Explicit

Sub RefreshData()
    Dim rs As DAO.Recordset
    CurrentDb.Execute "DELETE * FROM zTable1"
    DoEvents
    Set rs = CurrentDb.OpenRecordset("SELECT Dept FROM Table1 GROUP BY
Dept")
    rs.MoveFirst
    Do While Not rs.EOF
        CurrentDb.Execute "INSERT INTO zTable1 (Dept, Amount) SELECT TOP 3
Dept, Amount FROM Table1 WHERE Dept = '" & Nz(rs(0), "") & "'"
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing
    Me.Requery
End Sub


Private Sub Form_Open(Cancel As Integer)
    RefreshData
End Sub


Idenya seperti itu, tinggal mahmoed kembangin sesuai kebutuhan.
Untuk membentuk dalam satu query, saya belum bisa.


aksan kurdin



2008/6/24 Ivan Leonardo <[EMAIL PROTECTED]>:

Oh iya ya saya kurang teliti, nah kalo kaya gitu ribet nih rumit emang. 
Yg terpikir oleh saya cuman cara ini :
1. mesti buat temp tbl yg isinya seluruh data yg mau di pilih, lalu 
tambahkan kolom nourut jenis number byte
2. buat coding vba utk isi nourut masing2 jenis grup, contoh :
a. open recordset tbl-temp order by group (ascending) dan orderby nilai 
(descending)
b. looping through all record lalu looping through group (kan group tadi 
udah di order) jd langsung aja isi kolom nourut 1,2,3,4 sejalan dengan 
looping group kalo kode group A ada 10 maka nourut sampe 10 dan kalo 
ketemu group baru mulai urut dari 1 lagi.
3. nah kalo kolom nourut utk masing2 group sdh terisi kan masing2 group 
pasti ada nourut 1-3
4. nah tinggal delete deh yg nourut > 3, jdnya yg tersisa kan semua 
group yg punya urut 1-3

dari sini tbl-temp tinggal dipake deh utk create report/form, isi sudah 
top 3

mungkin ada cara yg lebih mudah ?



----------------------------------------------------------
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. E-mail transmission cannot be guaranteed to be
secure or error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The sender
therefore does not accept liability for any errors or omissions in the
contents of this message, which arise as a result of e-mail transmission. If
verification is required please request a hard-copy version.

 

 

Kirim email ke