Dynamic Queries as basis of the reports

  • Thread starter Thread starter Frank Situmorang
  • Start date Start date
F

Frank Situmorang

Hello,

Currently I have a form containing option choose, to choose the report. Each
report will have a different query as the recourd source of the reports.

Since I am desgining my reports to have it in languages, so I prefer now to
have it only 1 report but can dynamically choose also the query.

Here is my Option choice:

Private Sub Command33_Click()
Select Case Me.FormChoice
Case 1
DoCmd.OpenReport "Laporan Buku Anggota Jemaat Kebayoran", acPreview
Case 2
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_Akftif", acPreview
Case 3
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_AkftifnNonAk",
acPreview
Case 4
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_Non_Akftif",
acPreview
Case 5
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_Prasasti", acPreview
Case 6
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_Akftif_All",
acPreview
Case 7
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_AkftifnNonAk_All",
acPreview
Case 8
DoCmd.OpenReport "Laporan Buku Anggota JemaatKBY_Non_Akftif_All",
acPreview
Case 9
DoCmd.OpenReport "Laporan Buku Anggota Jemaat Kebayoran_Consol",
acPreview


End Select
End Sub

My question is how can we make it to have dynamically choose the query:
Case 1
Report's records source is from Query1
Case 2
Report's records source is from Query2...

and so forth....

Can anyone help me to add VBA on this?

Thanks very much
 
Back
Top