DDH Software, Inc Making a big world smaller






Return to Knowledgebase Home
Tutorial VI: How to use the DB Popup field type
Product: General HanDBase TopicArticle Number: 253Creation Date: 11/30/2003

Information for the DB Popup field type can be found in the HanDBase Documentation for your device or the HanDBase Desktop. This documentation can be found on your computer if you've installed the software by going to Start - Programs/All Programs - HanDBase 4 - Documentation. You can also find links to download all of the documentation in Knowledgebase Article 95.

A DB Popup is quite a bit like a list, such as the list in a Popup field or a list in a Text field. The difference is that the items available to choose from are kept in a separate HanDBase database.

The first step to create a DB Popup is to create the database with the list of items. Then, create a second database with a DB Popup field, which can then be used to select data from the records in the first HanDBase database. If necessary, you can refer to Tutorial I: Designing and Using a Simple Database at http://www.ddhsoftware.com/knowledgebase.html?UID=2017091402044954.156.89.16&read=78 for a tutorial for creating a HanDBase database. In this tutorial, you will create a database called "Coffee types" to contain a list of types of coffee, and you will create a second database that will pick values from "Coffee types". This can be done on the handheld or on the desktop. If you create the database on the desktop, be sure to select the proper handheld username to install the database to when you save or close the databases.

Step 1: Create the HanDBase database with the list of items

1. Create a new HanDbase database called "Coffee types".

2. For "Field 1", create a Text field type called "Coffee". Note that you do not have to use a Text field type for fields used by a DB Popup, but a Text field type is the most flexible.

3. For "Field 2", create a Text field type called "Description".

4. Once the fields are created, add records to this database. For the first record, add "Mocha Java" for the "Coffee" field, and then add "Smooth, lots of flavor".

5. Next add 5 more records, with the following values:

Coffee typesDescription
KonaExpensive, very smooth
SumatraDark roast with hints of spice
Italian RoastDark roast, almost sweet
Mexican AlturaLight roast, very smooth
PeaberryLots of flavor, small beans

6. Close and save the "Coffee types" database. If you created this on the desktop, make sure to select the correct handheld username to install the database to that handheld

7. If using a Palm handheld, perform a HotSync. If using a Pocket PC handheld, sync with the HanDBase Conduit.

Step 2: Create the main database with the DB Popup

1. Create a new database called "Coffee drinking"

2. For "Field 1", create a Date field type called "Date"

3. For "Field 2", create a field type of DB Popup, called "Drink"

4. If on the desktop, use the Browse button next to Other database name. If on the handheld, use the down arrow next to Other DB name. Then select the "Coffee types" database. If on the desktop, select the handheld username that you chose to install the "Coffee types" database to, and then select the "Coffee types" database. If on the handheld, you should see the "Coffee types" database in the list of available databases.

5. After you select the "Coffee types" database, use the down arrow next to Other field name. Select the first field in the "Coffee types" database, called "Coffee".

6. Leave all other options as their default, and then add a record to this new database.

7. When adding a record to this database, the "Date" field should fill in with today's date. Click or tap on the down arrow next to the "Drink" field.

8. You should now see a list of records from the "Coffee types" database. Select the second record, "Kona". When you do, the value "Kona" will be in the "Drink" field.

9. Create another record, and select a different value for the "Drink" field from the "Coffee types" database. Or, select the "Kona" record again. The value of the record you select will be filled in.

10. Close and save the "Coffee types" database. If you created this on the desktop, make sure to select the correct handheld username to install the database to that handheld

11. If using a Palm handheld, perform a HotSync. If using a Pocket PC handheld, sync with the HanDBase Conduit.

Step 3: Add grouping to the DB Popup

You can have more than one DB Popup in a HanDBase database, and group the DB Popups so they work together.

1. Open the "Coffee drinking" database

2. Open DB Properties for the database to add a new field.

3. For "Field 3", add a new field called "Description" with the field type of DB Popup

4. If on the desktop, use the Browse button next to Other database name. If on the handheld, use the down arrow next to Other DB name. Then select the "Coffee types" database. If on the desktop, select the handheld username that you chose to install the "Coffee types" database to, and then select the "Coffee types" database. If on the handheld, you should see the "Coffee types" database in the list of available databases.

5. After you select the "Coffee types" database, use the down arrow next to Other field name. Select the second field in the "Coffee types" database, called "Description"

6. In the setting for Group, enter a number 1.

7. Close the properties for that new field, and then open the field properties for field 2, the "Drink" field.

8. In the "Drink" field, enter a number 1 for the Group setting.

9. Now close the properties and add a new record. For the new record, use the down arrow next to "Drink" or "Description" (the new field that was added), and you will see the list of records in the "Coffee types" database.

10. Select a record from "Coffee types", and you will see that both the drink and the description fields are filled in with the values from that record.

11. Open the first record that you created, and tap the down arrow next to "Drink". Select the "Kona" record again, and this time the description for that coffee will appear in the "Description" field.


This article has been viewed 1 times.

Return to Knowledgebase Home