Difference between revisions of "A club membership database"

From Apache OpenOffice Wiki
Jump to: navigation, search
(A base tutorial - First use of MediaWiki export from odt -)
 
m (Chapter 1 Table, Querys, Forms)
 
(67 intermediate revisions by 5 users not shown)
Line 1: Line 1:
//[[Image:../New%20Folder%20(2)/Club_Membership_Tutorial_html_m3d2d647c.png]]
+
__TOC__
  
 +
<big><big>Base Tutorial</big></big>
  
 +
<big>Building a club membership database</big>
 +
-----------------------
  
 
+
=Chapter 1 Table, Querys, Forms=
 
+
 
+
Base Tutorial
+
 
+
Building a club membership databaseChapter 1
+
 
+
Table, Querys, Forms
+
 
+
 
+
  
 
== Copyright ==
 
== Copyright ==
This document is Copyright © 2007 by its contributors as listed in the section titled Authors. You can distribute it and/or modify it under the terms of either the GNU General Public License, version 2 or later (http://www.gnu.org/licenses/gpl.html), or the Creative Commons Attribution License, version 2.5 (http://creativecommons.org/licenses/by/2.5/) or later.
+
This document is Copyright © 2007 by its contributors as listed in the section titled Authors. You can distribute it and/or modify it under the terms of either the GNU General Public License, version 2 or later (https://www.gnu.org/licenses/gpl.html), or the Creative Commons Attribution License, version 2.5 (https://creativecommons.org/licenses/by/2.5/) or later.
  
 
All trademarks within this guide belong to their legitimate owners.
 
All trademarks within this guide belong to their legitimate owners.
  
 
== Authors ==
 
== Authors ==
Andrew 'Drew' Jensen
+
Andrew 'Drew' Jensen († Oct 4, 2021)
 
+
== Feedback ==
+
Maintainer: DrewJensenPlease direct any comments or suggestions about this document to:[mailto:drewjensen.inbox@gmail.com drewjensen.inbox@gmail.com][mailto:authors@user-faq.openoffice.org ]
+
 
+
== Acknowledgments ==
+
[Optional section.]
+
  
 
== Publication date and software version ==
 
== Publication date and software version ==
 
Published 04/10/07. Based on OpenOffice.org 2.0.4 or greater.
 
Published 04/10/07. Based on OpenOffice.org 2.0.4 or greater.
 
+
----------------------<br>
Contents
+
 
+
__TOC__
+
  
 
= Introduction =
 
= Introduction =
Line 50: Line 35:
  
 
If you perform the steps described here I believe this should take roughly 2 hours to complete.  
 
If you perform the steps described here I believe this should take roughly 2 hours to complete.  
 
  
 
'''Objectives'''
 
'''Objectives'''
Line 61: Line 45:
 
* Show how to generate labels using Writer and Base together
 
* Show how to generate labels using Writer and Base together
 
* Show how to generate mail merged files using Writer and Base
 
* Show how to generate mail merged files using Writer and Base
 +
* Show how to link data from Base into a Calc document for export, with automatic refresh
 +
 
'''What '''
 
'''What '''
  
Line 80: Line 66:
 
* Business
 
* Business
 
* Contacts
 
* Contacts
* Select All Fields <Next>
+
* Select All Fields  
* – rename ContactID -> MemberID
+
* {{button|Next}}
* – rename ContactTypeID -> MemberTypeID
+
* – rename ContactID <big>→</big> MemberID
 +
* – rename ContactTypeID <big>→</big> MemberTypeID
 
* '''– Change the Field Type of MemberTypeID to TEXT[VARCHAR_IGNORECASE]'''
 
* '''– Change the Field Type of MemberTypeID to TEXT[VARCHAR_IGNORECASE]'''
 
* – Order the columns using the up / down buttons
 
* – Order the columns using the up / down buttons
* [[Image: Image 2]]
+
[[Image:Tutorial_html_m6d3d255c.png|Image 1]]
  
 
=== - Add Fields ===
 
=== - Add Fields ===
Line 92: Line 79:
 
* LastPayment ( Date )
 
* LastPayment ( Date )
 
* AmountDues ( Decimal(10,2) )
 
* AmountDues ( Decimal(10,2) )
* [[Image: Image 3]]
+
[[Image:Tutorial_html_m303cad1f.png|Image 2]]
  
 
*  
 
*  
* <Next>
+
* {{button|Next}}
* Select Use Existing Field as Primary Key
+
* Select 'Use an existing field as a primary key'
* Select MemberID and Check Auto_Value
+
* Select field MemberID and check Auto_Value
* [[Image: Image 4]]
+
[[Image:Tutorial_html_7b685c1d.png|Image 3]]
<Next>
+
* {{button|Next}}
* Name the table Members and Select 'Create Form Based on Table'
+
* Name the table Members and Select 'Create a form based on this table'
* [[Image: Image 5]]
+
[[Image:Tutorial_html_1397791d.png|Image 4]]
<Finish>
+
* {{button|Finish}}
*
+
*
+
 
* Select all the fields
 
* Select all the fields
* [[Image: Image 6]]
+
* [[Image:Tutorial_html_m5def7edc.png|Image 5]]
<Next>
+
* {{button|Next}}
* <Next>
+
* {{button|Next}}
* <Next>
+
* {{button|Next}}
* <Next>
+
* {{button|Next}}
* Change the style to Light Grey and the Field Border to Flat
+
* Change the style to Light Gray and the Field Border to Flat
* [[Image: Image 7]]
+
[[Image:Tutorial_html_4e0376c3.png|Image 6]]
  
* <Next>
+
* {{button|Next}}
 
* Name the form Member_master_list
 
* Name the form Member_master_list
* [[Image: Image 8]]
+
[[Image:Tutorial_html_233c198d.png|Image 7]]
<Finish>
+
* {{button|Finish}}
 
* The Member_master_list form will be open and ready for input.
 
* The Member_master_list form will be open and ready for input.
*
+
[[Image:Tutorial_html_m3d6b5b38.png|Image 8]]
*
+
 
* [[Image: Image 9]]
+
 
Close the form window.
 
Close the form window.
* At this point you have the Base file Members.odb, a table named Members and a form Members_Master_List – This would be a good time to save your work.
+
At this point you have the Base file Members.odb, a table named Members and a form Members_Master_List.
*
+
 
 +
'''<big>This would be a good time to save your work.</big>'''
 +
 
 
= Now we want to create some more forms and reports. =
 
= Now we want to create some more forms and reports. =
 
== Three forms more ==
 
== Three forms more ==
 
:( for a total of four forms ( views ) of the one table in the database ):
 
:( for a total of four forms ( views ) of the one table in the database ):
  
Members_dues form ( list members by name and allow editing of the financial information )
+
* Members_dues form ( list members by name and allow editing of the financial information )
Members_Contact_Information ( list members by name and allow editing of members contact information )
+
* Members_Contact_Information ( list members by name and allow editing of members contact information )
Members_Family_Information ( list members by name and allow editing of the members extended information )
+
* Members_Family_Information ( list members by name and allow editing of the members extended information )
 +
* Members_Master_List ( this was the form created for us from the table wizard, it has all fields in the table )
 +
 
 
== Four reports ==
 
== Four reports ==
Master_Members_list
+
* Master_Members_list
Members_Dues
+
* Members_Dues
Members_Contact_list
+
* Members_Contact_list
Members_Contact_Extended_List
+
* Members_Contact_Extended_List
 +
 
 +
You may be tempted at this moment to use the form wizard to just create these forms, for each basing the form on the table Members. However, I feel it is better to create queries that select the different fields wanted on these forms, then base the actual form on this query. For one thing, a number of queries can be used to feed both forms, sub_forms and reports. If there needs to be a change made to how some of the information is displayed, then an update to the query will update all other forms and reports that use the query.
  
You may be tempted at this moment to use the form wizard to just create these forms, for each basing the form on the table Members. However, I feel it is better to create queries that select the different fields wanted on these forms, then base the actual form on this query. For one thing, a number of queries can be used to feed both forms, sub_forms and reports. If there needs to be a change made to how some the information is displayed then an update to the query will update all other forms and reports that use the query.
 
 
== All together there will be seven queries ==
 
== All together there will be seven queries ==
Query_Dues
+
* Query_Dues
Query_Contact_Information
+
* Query_Contact_Information
Query_Family_Information
+
* Query_Family_Information
Query_Total_Dues
+
* Query_Total_Dues
Query_Members
+
* Query_Members
Query_Count_Members
+
* Query_Count_Members
Query_Birthday_this_month
+
* Query_Birthday_this_month
* == Using the query designer to generate these queries. ==
+
 
 +
== Using the query designer to generate these queries. ==
 
=== Query_Dues ===
 
=== Query_Dues ===
Start the designer Add the table Members
+
Start the designer
Add the fields MembersID, LastName, FirstName, RenewalDate, LastPayment, AmountDues  
+
:: Add the table Members
In the Alias column rename the fields Last Name, First Name, Renewal Date, Last Payment, Amount
+
:: Add the fields  
 +
::: MemberID, LastName, FirstName, RenewalDate, LastPayment, AmountDues
 +
 
 +
In the Alias column, rename the fields Last Name, First Name, Renewal Date, Last Payment, Amount
 +
 
 +
[[Image:Tutorial_html_4c65a1b.png|Image 9]]
 +
 
 
Keeping the designer open – select Run Query
 
Keeping the designer open – select Run Query
  
*
+
* In the results window select the COLUMN Amount by clicking the word Amount.
*
+
* In the results window select the COLUMN Amount by clicking the work Amount.
+
 
* Right click and select Column Format
 
* Right click and select Column Format
* This brings up the field Format dialog box
+
* This brings up the Field Format dialog box
 
* Select Category Currency and an appropriate currency display type
 
* Select Category Currency and an appropriate currency display type
* [[Image: Image 11]]
+
[[Image:Tutorial_html_edb7e0d.png|Image 10]]
<OK>
+
* {{button|OK}}
*
+
 
* Save the query as Query_Dues and close the designer window.
 
* Save the query as Query_Dues and close the designer window.
*
+
 
 
=== Query_Contact_Information ===
 
=== Query_Contact_Information ===
 
* Start the designer – Add the table Members
 
* Start the designer – Add the table Members
Line 170: Line 165:
 
* In the Alias column rename the fields Last Name, First Name, St., ZIP, Email, Phone, Cell, FAX
 
* In the Alias column rename the fields Last Name, First Name, St., ZIP, Email, Phone, Cell, FAX
 
* Keeping the designer open – select Run Query
 
* Keeping the designer open – select Run Query
* [[Image: Image 12]]
+
[[Image:Tutorial_html_m30549f18.png|800px|Image 11]]
Save the query as Query_Contact_Information
+
* Save the query as Query_Contact_Information
*
+
 
*
+
*
+
 
=== Query_Family_Information ===
 
=== Query_Family_Information ===
* Start the designer Add the table Members
+
* Start the designer  
* Add the fields MembersID, LastName, FirstName, MaritalStatus, SpouseName, ChildrenNames
+
:: Add the table Members
 +
:: Add the fields  
 +
::: MembersID, LastName, FirstName, MaritalStatus, SpouseName, ChildrenNames
 
* In the Alias column rename the fields Last Name, First Name, Marital Status, Spouse, Children
 
* In the Alias column rename the fields Last Name, First Name, Marital Status, Spouse, Children
 +
[[Image:Tutorial_html_4f4dd4df.png|Image 12]]
 
* Keeping the designer open – select Run Query
 
* Keeping the designer open – select Run Query
* [[Image: Image 13]]
+
* Save the query as Query_Family_Information
Save the query as Query_Family_Information
+
*
+
* Because these queries are based on the single table Members, and so long as we include the Primary Key field from the table, any form based on the query will be updateable.
+
*
+
* [[Image: Image 14]]
+
  
*
+
Because these queries are based on the single table Members, and so long as we include the Primary Key field from the table, any form based on the query will be updateable.
== Start the create form Wizard  ==
+
 
*
+
[[Image:Tutorial_html_m444aebea.png|800px|Image 13]]
 +
 
 +
== Start the Create form Wizard  ==  
 
* Select only the fields Lastname, FirstName, LastPayment, AmountDues, RenewalDate
 
* Select only the fields Lastname, FirstName, LastPayment, AmountDues, RenewalDate
* [[Image: Image 15]]
+
[[Image:Tutorial_html_3bfcfbc8.png|Image 14]]
<Next>
+
* {{button|Next}}
*
+
 
*
+
''Author:[[User:DrewJensen|Drew Jensen]] 17:47, 11 September 2007 (CEST)''<br>
*  
+
''Please do not change the logical content of this site without
 +
acknowledge of the author.''
 +
 
 +
== Link ==
 +
* Link to download sample-file: will follow
  
[[Category:Database]]
+
[[Category:Base]]
 
[[Category:Base Example]]
 
[[Category:Base Example]]
 
[[Category:Base Tutorials]]
 
[[Category:Base Tutorials]]

Latest revision as of 14:38, 2 August 2022

Base Tutorial

Building a club membership database


Chapter 1 Table, Querys, Forms

Copyright

This document is Copyright © 2007 by its contributors as listed in the section titled Authors. You can distribute it and/or modify it under the terms of either the GNU General Public License, version 2 or later (https://www.gnu.org/licenses/gpl.html), or the Creative Commons Attribution License, version 2.5 (https://creativecommons.org/licenses/by/2.5/) or later.

All trademarks within this guide belong to their legitimate owners.

Authors

Andrew 'Drew' Jensen († Oct 4, 2021)

Publication date and software version

Published 04/10/07. Based on OpenOffice.org 2.0.4 or greater.



Introduction

Why?

The genesis of this particular tutorial database came from an email at users@dba.openoffice.org.

I am looking for an alternative to Lotus Approach which is a database in their own language. Looks and works like a spreadsheet and does a lot more beside which is important. I am using it for a membership database with around 36 columns and over 50 lines.

Each member's details is in a line. I need to access records quite frequently, weekly and monthly at least to change anything and everything:, e.g.; phone numbers; e-mail addresses, delete members; add new members; change addresses; change subscription details which occupy 4 columns and to get outputs. My access is required to remove existing or make up completelynew lines but mostly it involves altering the content of 1 to 4 Fields only, and to get different outputs.The outputs used are in 9 types; 6 in different mini-spreadsheet layouts from 3 to 15 different columns and all the 50+ lines; 1 form that includes all the individual's details, i.e.,. every field in a line for 1 member at a time; 1 that is for addressing envelopes; and 1 that will print a 3x7 labelA4 sheet of address labels.With Lotus Approach if any single field or line is changed on the main worksheet or any of the 'outputs' the identical field is changed at the same time automatically on every other one of the 9 outputs without requiring any additional action from me. I need this from OOo.Unfortunately, and the reason for me looking to use OOo is that very few people have Lotus SW and I have to duplicate my efforts and find work-a-rounds whenever output is required for MS Word documents or sending in e-mail messages. Spreadsheets on their own involved a lot of extra work keeping them in parallel and up to date or copying and pasting to produce extracts. This is when errors creep in. That is why I moved to Approach. I have very little knowledge of SQL, or equal, working and do not know how to proceed in this case. With Approach it is not necessary. I imagine that MS Access would do all that I want with ease but at a price that for me to finance personally is not-on. If I can get OOo working in the way I need, like Approach, it will obviously be of interest to others. It may alreadydo it all but I struggle to find out how, hence my requests for help when the Help pages get me lost!

Am I asking too much from OOo at this stage in its development?


Well, I don't think so and what follows is a step by step example of how to build a database to do something similar as to what this person was describing.

If you perform the steps described here I believe this should take roughly 2 hours to complete.

Objectives

  • Demonstrate the use of Table, Form and Report wizards.
  • Demonstrate the use of the Query Designer – including use of simple formatting functions within the designer to generate result sets specifically for the report wizard.
  • Demonstrate how to edit a report created with the report wizard to add some summary data.
  • Show the use of queries to supply both multiple forms and reports
  • Demonstrate some helpful tips and tricks for building more friendly data entry forms
  • Show how to generate labels using Writer and Base together
  • Show how to generate mail merged files using Writer and Base
  • Show how to link data from Base into a Calc document for export, with automatic refresh

What

The example database described here will consist of:
  • 1 Table
  • 4 Forms
  • 4 Reports
  • 7 Queries
  • 1 Address label document
  • 1 Calc export document

Create the database file

  • Name: Members23
  • Type: HSQL
  • Connection: embedded

Create table using the wizard

  • Business
  • Contacts
  • Select All Fields
  •  Next 
  • – rename ContactID MemberID
  • – rename ContactTypeID MemberTypeID
  • – Change the Field Type of MemberTypeID to TEXT[VARCHAR_IGNORECASE]
  • – Order the columns using the up / down buttons

Image 1

- Add Fields

  • JoinedDate ( Date )
  • RenewalDate ( Date )
  • LastPayment ( Date )
  • AmountDues ( Decimal(10,2) )

Image 2

  •  Next 
  • Select 'Use an existing field as a primary key'
  • Select field MemberID and check Auto_Value

Image 3

  •  Next 
  • Name the table Members and Select 'Create a form based on this table'

Image 4

  •  Finish 


  • Select all the fields
  • Image 5
  •  Next 
  •  Next 
  •  Next 
  •  Next 
  • Change the style to Light Gray and the Field Border to Flat

Image 6

  •  Next 
  • Name the form Member_master_list

Image 7

  •  Finish 
  • The Member_master_list form will be open and ready for input.

Image 8

Close the form window. At this point you have the Base file Members.odb, a table named Members and a form Members_Master_List.

This would be a good time to save your work.

Now we want to create some more forms and reports.

Three forms more

( for a total of four forms ( views ) of the one table in the database ):
  • Members_dues form ( list members by name and allow editing of the financial information )
  • Members_Contact_Information ( list members by name and allow editing of members contact information )
  • Members_Family_Information ( list members by name and allow editing of the members extended information )
  • Members_Master_List ( this was the form created for us from the table wizard, it has all fields in the table )

Four reports

  • Master_Members_list
  • Members_Dues
  • Members_Contact_list
  • Members_Contact_Extended_List

You may be tempted at this moment to use the form wizard to just create these forms, for each basing the form on the table Members. However, I feel it is better to create queries that select the different fields wanted on these forms, then base the actual form on this query. For one thing, a number of queries can be used to feed both forms, sub_forms and reports. If there needs to be a change made to how some of the information is displayed, then an update to the query will update all other forms and reports that use the query.

All together there will be seven queries

  • Query_Dues
  • Query_Contact_Information
  • Query_Family_Information
  • Query_Total_Dues
  • Query_Members
  • Query_Count_Members
  • Query_Birthday_this_month

Using the query designer to generate these queries.

Query_Dues

Start the designer

Add the table Members
Add the fields
MemberID, LastName, FirstName, RenewalDate, LastPayment, AmountDues

In the Alias column, rename the fields Last Name, First Name, Renewal Date, Last Payment, Amount

Image 9

Keeping the designer open – select Run Query

  • In the results window select the COLUMN Amount by clicking the word Amount.
  • Right click and select Column Format
  • This brings up the Field Format dialog box
  • Select Category Currency and an appropriate currency display type

Image 10

  •  OK 
  • Save the query as Query_Dues and close the designer window.

Query_Contact_Information

  • Start the designer – Add the table Members
  • Add the fields MembersID, LastName, FirstName, Address, City, StateOrProvince, PostalCode, EmailAddress, PhoneNumber, MobileNumber, FaxNumber
  • In the Alias column rename the fields Last Name, First Name, St., ZIP, Email, Phone, Cell, FAX
  • Keeping the designer open – select Run Query

Image 11

  • Save the query as Query_Contact_Information

Query_Family_Information

  • Start the designer
Add the table Members
Add the fields
MembersID, LastName, FirstName, MaritalStatus, SpouseName, ChildrenNames
  • In the Alias column rename the fields Last Name, First Name, Marital Status, Spouse, Children

Image 12

  • Keeping the designer open – select Run Query
  • Save the query as Query_Family_Information

Because these queries are based on the single table Members, and so long as we include the Primary Key field from the table, any form based on the query will be updateable.

Image 13

Start the Create form Wizard

  • Select only the fields Lastname, FirstName, LastPayment, AmountDues, RenewalDate

Image 14

  •  Next 

Author:Drew Jensen 17:47, 11 September 2007 (CEST)
Please do not change the logical content of this site without acknowledge of the author.

Link

  • Link to download sample-file: will follow
Personal tools