Cara Menginstall / Instalasi Ubuntu Server



























Anda Sopan Kami Segan
































A sales report can include a lot of numbers. Sebuah laporan penjualan dapat mencakup banyak angka. That's why you'll need to calculate sums at the appropriate locations in a report. Itulah mengapa Anda akan perlu untuk menghitung jumlah di lokasi yang tepat dalam laporan. In this article, learn how to place calculated sums in your reports. Pada artikel ini, belajar bagaimana untuk menempatkan jumlah yang dihitung dalam laporan Anda. We provide a downloadable database with examples. Kami menyediakan database download dengan contoh-contoh.
| Applies to Berlaku untuk |
|---|
| Microsoft Office Access 2003 Microsoft Office Access 2003 Microsoft Access 2000 and 2002 Microsoft Access 2000 dan 2002 |
Question: How do I display totals at the end of my report? Pertanyaan: Bagaimana cara menampilkan total di akhir laporan saya?
You create a calculated control in the report footer. Anda membuat kontrol dihitung dalam laporan footer. A calculated control is one whose source of data is an expression rather than a field. Suatu pengendalian yang dihitung adalah salah satu sumber data adalah ungkapan daripada lapangan. When you open a report that contains a calculated control, Access calculates the correct value by using the current data. Bila Anda membuka sebuah laporan yang berisi kontrol dihitung, akses menghitung nilai yang benar dengan menggunakan data saat ini. For example, to print the current date on a report, you enter the expression =Date() in a text box. Date is a built-in function that returns the current date as stored in your computer's system clock. Misalnya, untuk mencetak tanggal saat ini pada laporan, Anda masukkan ekspresi = Tanggal () dalam kotak teks. Tanggal adalah built-in fungsi yang mengembalikan tanggal saat ini sebagai disimpan dalam sistem jam komputer Anda. When Access runs this report, the expression in the calculated control, Date(), is evaluated, and the current date is displayed in the control on the report. Ketika berjalan Akses laporan ini, istilah dalam kontrol dihitung, Tanggal (), dievaluasi, dan tanggal saat ini ditampilkan dalam kontrol pada laporan tersebut
Menghitung total kelompok atau laporan
To calculate the sum of the quantities ordered for the entire report, you place a text box control in the report footer and set the ControlSource property of the text box to the following expression: Untuk menghitung jumlah dari jumlah memerintahkan untuk seluruh laporan, Anda menempatkan kotak kontrol teks dalam footer laporan dan menyetel properti ControlSource dari kotak teks untuk ekspresi berikut:
=Sum([QuantityOrdered]) = Sum ([QuantityOrdered]) The Sum function calculates the total for a set of values from your record source — in this case, the column named QuantityOrdered. Sum is one of the aggregate functions in Access that you can use to calculate summary values. Fungsi Sum menghitung total untuk satu set nilai dari sumber catatan Anda - hal ini, kolom bernama QuantityOrdered. Di Sum adalah salah satu fungsi agregat di Access yang dapat Anda gunakan untuk menghitung nilai ringkasan.
Most totals are generated by calculating a sum, either for a group of records or for all records. Kebanyakan total dihasilkan oleh menghitung jumlah, baik untuk sekelompok catatan atau untuk semua catatan. When you calculate a sum, the section of the report in which you place the calculated control containing the sum expression is important. Bila Anda menghitung jumlah, bagian laporan di mana Anda menempatkan kontrol dihitung berisi ekspresi jumlah adalah penting. Access determines how to aggregate the sum based on where you place the control — that is, based on what section of the report you choose. Akses menentukan bagaimana jumlah agregat berdasarkan tempat Anda - kontrol yang berdasarkan pada apa bagian laporan yang Anda pilih.

For example, to calculate a total for one record, you create a calculated text box in the Detail section. Misalnya, untuk menghitung total untuk satu record, Anda membuat kotak teks dihitung pada bagian Detail. To calculate a total for a group of records, such as for each product in a report that's grouped by product, you create a calculated text box in the Group Header or Group Footer section for that group. Untuk menghitung total untuk sekelompok catatan, misalnya untuk setiap produk dalam sebuah laporan yang dikelompokkan menurut produk, Anda membuat kotak teks dihitung di Header Grup atau Kelompok bagian footer untuk grup tersebut. To print a grand total for the entire report, you create a calculated text box in the Report Header or Report Footer section of the report. Untuk mencetak jumlah besar untuk seluruh laporan, Anda membuat kotak teks dihitung di Header Report atau Laporan bagian footer laporan.

For detailed step-by-step instructions on how to create a calculated control for a total in the report footer, see the following expandable section: Untuk petunjuk langkah-demi-langkah rinci tentang cara membuat kontrol dihitung untuk total di footer laporan, lihat bagian expandable berikut:
Step-by-step: How to place a calculated control for a total in a report footer Langkah-langkah: Bagaimana untuk menempatkan kontrol dihitung untuk total dalam laporan footer
To open the report in Design view Untuk membuka laporan dalam Desain tampilan
To create the text box control Untuk membuat kontrol kotak teks
Note If the toolbox is not visible, on the View menu, click Toolbox . Catatan Jika toolbox tidak terlihat, pada menu View, klik Toolbox.
To set the ControlSource property of the text box Untuk mengatur properti ControlSource dari kotak teks
Access divides the design for a report into sections. Akses desain untuk membagi laporan menjadi beberapa bagian. The section in which you choose to place a calculated control determines how Access calculates results for aggregate functions such as Sum . Bagian di mana Anda memilih untuk menempatkan kontrol dihitung menentukan bagaimana Akses menghitung hasil untuk fungsi-fungsi agregat seperti Sum. Here's a summary of the section types and their uses: Berikut adalah ringkasan dari jenis bagian dan menggunakan mereka:
Sometimes you want to calculate a total for each page of a report. Kadang-kadang anda ingin menghitung total untuk setiap halaman laporan. The page footer and header sections, however, do not support calculated controls that use aggregate functions such as Sum . Header footer dan bagian halaman, bagaimanapun, tidak mendukung kontrol menghitung bahwa menggunakan fungsi agregat seperti Sum. You can solve this problem with a little understanding of how reports work in Access, and a small amount of Microsoft Visual Basic® for Applications (VBA) code. Anda dapat memecahkan masalah ini dengan sedikit pemahaman tentang bagaimana laporan bekerja di akses, dan sejumlah kecil dari Microsoft ® Visual Basic for Applications (VBA) code. VBA is the programming language that Access uses. VBA adalah bahasa pemrograman yang menggunakan Access.
Access divides a report into sections and processes each section in turn according to its type. Akses membagi laporan menjadi beberapa bagian dan proses setiap bagian pada gilirannya menurut jenisnya. The Report Header section, for example, is printed once, at the beginning of the report. Bagian Laporan Header, misalnya, dicetak sekali, di awal laporan. The Page Header section, on the other hand, is printed at the top of every single page. Page Header bagian, di sisi lain, dicetak di bagian atas setiap halaman tunggal. Because reports often have many pages, the Page Header section tends to be called often. Karena laporan sering memiliki banyak halaman, bagian Page Header cenderung disebut sering. Normally, the most often called section is the Detail section because it's called once for every row in the report's record source. Biasanya, bagian yang paling sering disebut adalah bagian Detail karena dipanggil sekali untuk setiap baris dalam catatan sumber laporan itu.
So, when you run a report, the Access report engine gets busy processing the report sections, many of them repeatedly. Jadi, ketika Anda menjalankan laporan, laporan mesin Akses sibuk memproses mendapat bagian laporan, banyak dari mereka berulang kali. While it's processing report sections, Access also triggers a series of events (event: An action recognized by an object, such as a mouse click or key press, for which you can define a response. An event can be caused by a user action or a Visual Basic statement, or it can be triggered by the system.) that can be responded to by VBA code. Sementara itu bagian laporan pengolahan, Access juga memicu serangkaian acara (event: tindakan diakui oleh objek, seperti mouse atau klik tombol, tekan yang Anda dapat menentukan. respon Sebuah event dapat disebabkan oleh tindakan pengguna atau Visual Basic pernyataan, atau dapat dipicu oleh sistem). yang dapat ditanggapi oleh kode VBA. For example, the section's Format event occurs when Access has selected the data to go in a section, but before the data is actually formatted or printed. Sebagai contoh, seksi acara Format terjadi ketika Akses telah memilih data untuk pergi dalam bagian, tapi sebelum data sebenarnya diformat atau dicetak. You can use the Format event to intervene when you want to change a section layout on a page. Anda dapat menggunakan Format acara untuk campur tangan bila Anda ingin mengubah tata letak bagian halaman.
After the code in the Format event has been run, Access then formats the data and readies it for printing. Setelah kode di Format acara telah berjalan, maka akses format data dan menyiapkan untuk pencetakan. At this point, Access triggers the section's Print event. Pada titik ini, akses memicu Teman Cetak acara bagian. The Print event is a good place to perform calculations that are based on data that will appear on the current page because you're guaranteed the data will actually be printed on that page. Acara Cetak adalah tempat yang baik untuk melakukan perhitungan yang didasarkan pada data yang akan muncul pada halaman saat ini karena Anda dijamin data akan benar-benar dicetak pada halaman tersebut. There's no such guarantee with the Format event because Access can determine that the section won't fit on the current page. Tidak ada jaminan tersebut dengan peristiwa Format karena Access dapat menentukan bahwa seksi tidak akan muat di halaman ini.
To calculate and print page totals, you can use the Print event for the Detail section and for the Page Header section, in combination with two text box controls that you insert in the Page Footer section. Untuk menghitung dan mencetak total halaman, Anda dapat menggunakan event Cetak untuk bagian Detail dan untuk bagian Header Page, dalam kombinasi dengan dua kotak kontrol teks yang Anda masukkan di bagian Footer PT. This technique consists of the following steps: Teknik ini terdiri dari langkah-langkah berikut:
Here's the code for the Print event for the Detail section (called Detail_Print) and the Print event for the Page Header section (called PageHeaderSection_Print): Berikut kode untuk acara Cetak untuk bagian Detail (disebut Detail_Print) dan acara Cetak untuk bagian Header Halaman (disebut PageHeaderSection_Print):
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer) If PrintCount = 1 Then txtPageSum = txtPageSum + ExtendedPrice txtPageQuantity = txtPageQuantity + Quantity End If End Sub Private Sub PageHeaderSection_Print(Cancel As Integer, _ PrintCount As Integer) txtPageSum = 0 txtPageQuantity = 0 End Sub The PageHeaderSection_Print routine is called by the Print event of the page header at the top of every printed page. Rutin PageHeaderSection_Print disebut oleh peristiwa Print header halaman di bagian atas setiap halaman dicetak. Its job is to reset the two page totals, txtPageSum and txtPageQuantity, to zero so that every page begins anew with fresh, initialized page totals. Tugasnya adalah untuk me-reset total dua halaman, txtPageSum dan txtPageQuantity, ke nol sehingga setiap halaman dimulai lagi dengan segar, total halaman diinisialisasi. The Detail_Print routine is called by the Print event of the Detail section for each detail record. Rutin Detail_Print disebut oleh peristiwa Print Detail bagian untuk setiap record detail. Its job is to add the values for that record to the page total. Tugasnya adalah untuk menambahkan nilai untuk yang mencatat dengan total halaman. So, the value of ExtendedPrice is added to the value of txtPageSum to accumulate the page total for the sales amount, and the value of Quantity is added to the value of txtPageQuantity to accumulate the page total for quantity. Jadi, nilai ExtendedPrice akan ditambahkan ke nilai txtPageSum untuk mengumpulkan total halaman untuk nilai penjualan, dan nilai Kuantitas akan ditambahkan ke nilai txtPageQuantity untuk mengumpulkan total halaman untuk kuantitas.
Note that the value of the PrintCount property is checked, before any accumulating begins, to determine if it's set to one. Perhatikan bahwa nilai dari properti PrintCount diperiksa, sebelum mengakumulasi dimulai, untuk menentukan apakah itu diatur ke satu. Access increments this property by one whenever the data for the current section is printed. Akses kenaikan properti ini oleh salah satu setiap kali data untuk seksi saat ini adalah dicetak. Because there are times when the Print event for the Detail section for a particular record might be called more than once, checking the PrintCount value ensures that you don't add the same value twice to a page total. Karena ada kalanya acara Cetak untuk bagian Detail untuk catatan tertentu yang bisa disebut lebih dari sekali, memeriksa nilai PrintCount memastikan bahwa Anda tidak menambahkan nilai yang sama dua kali dengan total halaman.

You can download the sample database for this article. Anda dapat men-download database contoh untuk artikel ini. The Sales by Product with Page Total report in the sample database uses the technique shown earlier in this article for the page totals. Penjualan Berdasarkan Produk dengan laporan Halaman Total dalam database sampel menggunakan teknik yang ditampilkan sebelumnya dalam Pasal ini untuk halaman total. For detailed step-by-step instructions on how to create calculated page totals yourself, see the following expandable section: Untuk petunjuk langkah-demi-langkah rinci tentang cara membuat halaman dihitung total diri sendiri, lihat bagian expandable berikut:
Step-by-step: How to calculate page totals in a report Langkah-langkah: Bagaimana menghitung jumlah total halaman dalam laporan
To open the report in Design view Untuk membuka laporan dalam Desain tampilan
To create the text box controls Untuk membuat kotak teks kontrol
Note If the Toolbox is not visible, on the View menu, click Toolbox . Catatan Jika Toolbox tidak terlihat, pada menu View, klik Toolbox.
To set the page header Print property Untuk mengatur properti header Cetak halaman
To set the Detail section Print property Untuk mengatur properti bagian Print Detail
With Access you can create what is called a running sum. Dengan Access Anda dapat membuat apa yang disebut jumlah yang berjalan. A running sum is a total that is accumulated from record to record across a group, or even across the entire report. Sebuah jumlah yang berjalan adalah total yang akumulasi dari rekam untuk merekam seluruh grup, atau bahkan di seluruh laporan.

To create a running sum, you first create a text box and set its ControlSource property to the field or expression that you want to sum (ExtendedPrice, for example). Untuk membuat jumlah yang berjalan, Anda pertama kali membuat kotak teks dan set properti ControlSource ke kolom atau ekspresi yang ingin Anda jumlah (ExtendedPrice, misalnya). Then you set the RunningSum property of the text box. Kemudian Anda menyetel properti RunningSum dari kotak teks. The RunningSum property determines the range of records over which the text box values are accumulated. Properti RunningSum menentukan berbagai catatan di mana nilai-nilai kotak teks tersebut diakumulasikan. Here are the possible settings for the RunningSum property: Berikut adalah pengaturan yang mungkin untuk properti RunningSum:
Running Sum property values Menjalankan nilai properti Sum
To demonstrate this feature, I created the Sales by Product with Running Sum report in the sample database. Untuk menunjukkan fitur ini, saya menciptakan Penjualan berdasarkan Produk dengan laporan Running Sum dalam database sampel. I added a text box called Cumulative, and set its ControlSource property to ExtendedPrice . Saya menambahkan kotak teks yang disebut Kumulatif, dan set properti ControlSource untuk ExtendedPrice. Then I set its RunningSum property to Over Group , as shown here: Lalu aku set properti RunningSum untuk Lebih Group, seperti yang ditunjukkan di sini:

For step-by-step instructions to create a running sum, see the following expandable section: Untuk langkah-demi langkah petunjuk untuk membuat sejumlah berjalan, lihat bagian expandable berikut:
Step-by-step: How to create a running sum in a report Langkah-langkah: Cara membuat jumlah berjalan di laporan
To open the report in Design view Untuk membuka laporan dalam Desain tampilan
To create the text box control Untuk membuat kontrol kotak teks
Note If the toolbox is not visible, on the View menu, click Toolbox . Catatan Jika toolbox tidak terlihat, pada menu View, klik Toolbox.
To set the ControlSource property Untuk mengatur properti ControlSource
To set the RunningSum property Untuk mengatur properti RunningSum
Here's a tip related to using the RunningSum property. Berikut tip yang berhubungan dengan menggunakan properti RunningSum. Sometimes you may want to number the records on your report. Kadang-kadang Anda mungkin ingin nomor catatan pada laporan Anda. You can do this by using a calculated control and the RunningSum property. Anda dapat melakukan ini dengan menggunakan kontrol dihitung dan properti RunningSum. First, you create a text box and set its ControlSource property to =1 . Pertama, Anda membuat kotak teks dan set properti ControlSource untuk = 1.
Then you set the RunningSum property for the text box. Kemudian Anda mengatur properti RunningSum untuk kotak teks. If you want the numbering to start over for each group, set the property to Over Group . Jika Anda ingin penomoran untuk memulai lagi untuk masing-masing kelompok, mengeset properti ke Over Group. If you want to accumulate a running sum for the entire report, set the property to Over All . Jika Anda ingin mengumpulkan jumlah berjalan untuk seluruh laporan, mengeset properti ke Over All.
The expression sets the value of the text box control to 1. Ekspresi set nilai dari kontrol kotak teks untuk 1. Because the RunningSum property is used to accumulate the value, the text box is increased by one for every row. Karena properti RunningSum digunakan untuk mengumpulkan nilai, kotak teks bertambah satu untuk setiap baris. The Sales by Product with Running Sum and Numbered Rows report in the sample database demonstrates this technique. Penjualan Berdasarkan Produk dengan Running Sum dan laporan bernomor Rows dalam database contoh menunjukkan teknik ini. Entering a period (.) in the Format property box appends a period to the end of the number. Memasuki titik (.) Di kotak properti Format menambahkan masa akhir nomor.
Terima kasih atas tanggapan yang menyenangkan di artikel Membuat Fungsi Terbilang di Microsoft Excel, melalui email atau komentar. Lalu di halaman ini, ada permintaan atas artikel pembuatan fungsi terbilang di Microsoft Access, kebetulan sih saya pernah membuat proyek dengan Access yang menyertakan fungsi terbilang tersebut di dalamnya (jadi saya tinggal membongkar arsip saya karena proyek ini sudah berumur 6 tahun ketika saya pertama kali menceburkan diri ke dunia programming, saya ngga begitu ingat apakah script ini dari mailing list atau buat sendiri, tetapi kalau ada yang merasa ini adalah script anda, tolong kasi comment disini agar saya pasang link-nya).
Dan inilah langkah yang harus anda ambil untuk memasang fungsi terbilang ini di Microsoft Access:

Public Function ubah_terbilang(xbil As Double) Dim nilai, i, j, k, hasil$, HasilAkhir$, Bilangan#, Digit, Rp$, Bil$ If IsNull(xbil) Then ubah_terbilang = Null Exit Function End If 'pengelompokan Dim Kel$(1 To 6), Angka$(1 To 9), Sat$(1 To 3) Kel$(1) = "Biliun " Kel$(2) = "Triliun " Kel$(3) = "Miliar " Kel$(4) = "Juta " Kel$(5) = "Ribu " Kel$(6) = "" 'data angka Angka$(1) = "Satu " Angka$(2) = "Dua " Angka$(3) = "Tiga " Angka$(4) = "Empat " Angka$(5) = "Lima " Angka$(6) = "Enam " Angka$(7) = "Tujuh " Angka$(8) = "Delapan " Angka$(9) = "Sembilan " 'satuan Sat$(1) = "Ratus " Sat$(2) = "Puluh " Sat$(3) = "" 'mulai Bilangan# = Val(xbil) HasilAkhir$ = "" GoSub HitungHuruf If hasil$ <> "" Then HasilAkhir$ = hasil$ + "Rupiah" End If 'hitung pecahan Bilangan# = Fix((Bilangan# - Fix(Bilangan#) + 0.005) * 100#) If Bilangan# > 0 Then GoSub HitungHuruf If hasil$ <> "" Then HasilAkhir$ = HasilAkhir$ + " " + hasil$ + "Sen" End If End If ubah_terbilang = HasilAkhir$ Exit Function HitungHuruf: Rp$ = Right$(String$(18, "0") + LTrim$(Str$(Fix(Bilangan#))), 18) hasil$ = "" If Val(Rp$) = 0 Then Return 'blg bulat For i = 1 To 6 Bil$ = Mid$(Rp$, i * 3 - 2, 3) If Val(Bil$) = 1 And i = 5 Then hasil$ = hasil$ + "Seribu " ElseIf Val(Bil$) <> 0 Then For j = 1 To 3 Digit = Val(Mid$(Bil$, j, 1)) If j = 2 And Right$(Bil$, 2) = "10" Then hasil$ = hasil$ + "Sepuluh " Exit For ElseIf j = 2 And Right$(Bil$, 2) = "11" Then hasil$ = hasil$ + "Sebelas " Exit For ElseIf j = 2 And Mid$(Bil$, 2, 1) = "1" Then hasil$ = hasil$ + Angka$(Val(Right$(Bil$, 1))) + "Belas " Exit For ElseIf Digit = 1 And j = 1 Then hasil$ = hasil$ + "Seratus " ElseIf Digit <> 0 Then hasil$ = hasil$ + Angka$(Digit) + Sat$(j) End If Next hasil$ = hasil$ + Kel$(i) End If Next Return End Function
Ada dua cara untuk mencoba fungsi ini di Microsoft Access, melalui Form atau Report. Nah, kita akan mencoba yang pertama yaitu melalui Form:




Text2.Value = ubah_terbilang(Text0.Text) di dalam blok Private Sub Text0_Change().

Nah, dari contoh sederhana diatas anda dapat mengembangkannya sendiri menjadi aplikasi yang lebih baik. Untuk implementasi kedua adalah pada Report, penggunaannya sebagai berikut:

=ubah_terbilang([txtTOTAL].[Value]) di Control Source dari txtTerbilang.