You are on page 1of 27

An introduction to creating forms for ArcPad

This guide introduces the basic concepts of producing data collection forms using ArcPad Studio (Application Builder) and the Forms Wizard in ArcPad. A number of assumptions have been made. ArcGis v.8.2, ArcPad v.6.0 or v.6.0.1 and ArcPad Studio v.6.0 are installed on your desktop/laptop PC and ArcPad v.6.0 or v.6.0.1 are installed on your PDA. Familiarity in using ArcGis, including Arc toolbox and Arc catalogue are required as is a basic familiarity of ArcPad Help regarding ArcGis can be obtained from ITS, and a number of people in the department are familiar with using ArcGis, ArcPad and ArcPad Studio (see appendix). Contents Introduction Getting started Creating shape files Attribute tables DBF files Creating forms in ArcPad Studio Creating forms using Form Wizard Appendix

1 1 1 4 7 8 19 27

Introduction The use of GPS and field based GIS mapping tools provides a relatively quick and accurate means of capturi ng and visualising spatial data. Advances in both PDAs and GPS, combined with field-based GIS software such as ArcPad now provides a viable GIS and GPS based data collection methodology for field geologists. To speed the data capture work flow further it is possible to create a set of data collection forms using ArcPad Studio and or the form wizard in ArcPad (NB this requires version 6.0.1 of ArcPad and the form wizard applet, both are available free for registered users from the ESRI web site . See appendix) . These instructions will guide you through the process of creating forms and installing them onto your PDA Getting started Creating a form requires the completion of several important intermediate stages. It is therefore, worthwhile spending some time planning what data is to be collected as this will dictate a number of factors such as the shape files required, coordinate systems, fields in attribute tables, dbf files and the layout of the form itself. Creating shape files Before a form can be created it must be associated with a particular shape file e.g. bedding. If no such shape file exists it will have to be created. This is done using ArcCatalogue. We will create a shapefile called Bedding which will be used during the rest of this exercise. 1. Open ArcCatalogue (this can be done via ArcMap or opened independently). 2. Select File | New | Shapefile The Create New Shape File dialogue box appears. 3. In Name: enter Bedding. 4. From the Feature Type drop down box select the feature type i.e. Point, Line, Polygon or Multipoint. In this case select Point

5. To assign a coordinate system to the shapefile click Edit This will bring up the Spatial Reference Properties dialogue box. Click on select.

2
P.Clegg, ArcPad (forms) ver.1 28/07/2003

6. Depending on which coordinate system you wish to use, open the required folder and select the coordinate system and click Add. then OK. The Create New Shapefile dialogue box should now look something like this. With the selected coordinate system shown in the Description area of the box.

7. The new shapefile Bedding.shp is now shown in the ArcCatalogue window.

Shapefiles arent single files but come with a lot of extra baggage. Use Windows 3
P.Clegg, ArcPad (forms) ver.1 28/07/2003

Explorer to navigate to the folder where your shape file is stored. You will see that along with the Bedding.shp file there are three others.

Bedding.prj is the coordinate projection file (it tells ArcGis/ArcPad what coordinate system to use). Bedding.dbf is the attribute table (see below) and the Bedding.shx file links the .dbf and .shp files. It is important to keep all these related files together otherwise ArcGis and ArcPad cannot open the shapefile. Attribute Tables When a shape file is created an associated attribute table is also created (e.g. Bedding.dbf). The attribute table can be viewed in 2 ways: 1. Open ArcCatalogue select the shapefile and double click on it. The shapefile properties dialogue box will appear.

2. Alternatively open ArcMap and add the shapefile. In the table of contents (TOC) right click on the file and select open attribute table. The following table will appear. 4
P.Clegg, ArcPad (forms) ver.1 28/07/2003

By default three fields are formed within the attribute table when the shapefile is created. However, additional fields can be added. The method differs slightly depending on whether the editing is done within ArcCatalogue or ArcMap. The method described here is for editing within ArcMap. It is important to note at this stage that the fields available in the form are dependant on the fields present in the attribute table . Therefore, you should decide on all the fields you are likely to require as it is difficult to add them at a later stage. Fields in the attribute table do not need to be used in the form, but any field you wish to use must be in the attribute table. For example, if we want to record the following bedding data in the field: Formation Strike Dip Dip direction Bed thickness We need to add a field to the attributes table for each of these characteristics. 1. Open the attribute table you wish to edit 2. Click Options | Add Field and the Add Field dialogue box will appear.

3. In Name text box type Formation 4. Click Type and select Text 5
P.Clegg, ArcPad (forms) ver.1 28/07/2003

5. In Field Properties box indicate the maximum number of characters you want to be able to enter into the field. In this case enter 15 (this includes spaces up to a maximum of 50). The default is 50. Reducing the number of characters also reduces the width of the column in the attributes file. An important consideration if you are adding several text fields as not all the fields may be visible without scrolling. 6. Click OK 7. Add a date field. In the Name text box type Date_ you cannot call it Date as this is also the name of a Field Type. 8. Add a number field . There are several number Field Types to choose from. The safest option is to choose Float. In the Name text box type Strike. 9. In Field Properties there are two selection boxes: Precision and Scale. Precision defines the number of integers, so in the case of Strike this should be set to 3. Scale defines the number of decimal places, in this case leave this as 0. 10. Click OK 11. Continue like this until you have added all the fields required. It is useful to add another field such as Other; which will allow for brief notes to be made. Note: No two fields can have the same name Field names cannot contain spaces and must be a maximum of 10 characters

12. Fields cannot be edited once they are created. If a mistake is made or you wish to modify a field the existing field must be deleted. 13. Right click the field header to view a list of options, select delete field and click on OK. Once the attribute table has been edited close it down and exit ArcMap. There is no need to save the untitled map.

6
P.Clegg, ArcPad (forms) ver.1 28/07/2003

Dbf Files It is possible to create forms that use drop down pick lists that contain data that is used frequently or is time consuming to type in. The text or numbers that you wish to display in a pick box need to be in a dbf file. These can be created in Excel, Access or some other spreadsheet/database application and saved as a dbf file. Each file should consist of two columns as shown below.

You need to create four dbf files for use later on in the exercise; forname.dbf. Lay out as shown above and use the same names strikevalues.dbf. The Value field should range from 1 362 and the strike field should range from 1-360 plus 999. (ArcGis uses the Right Hand Rule of recording strike and dip i.e. dip direction is always recorded in a clockwise direction relative to strike). dip.dbf. The Value field should range from1 92 and the Dip field from 0 90 plus 99 dip_dir.dbf The Value field should range from 1-9 and the Direction field should include: N, S, E, W, NE, NW, SE, SW, and Unknown These files should be saved on your root drive (see below). In some circumstances no data may be available for a certain field at a particular location. By default a zero or null value will be recorded. In these instances it is advisable to be able to record an Unknown or a number that is easily distinguished e.g. in the case of Strike, 999. This means that these values can be easily filtered out during statistical analysis. One of the peculiarities of the Arc family of applications is the need to have some files in a root directory i.e. not within a folder or sub-folder. This only appears to be necessary for certain operations, which once undertaken the files can then be stored in folders. If you experience problems with certain operations using Arc software this is often the cause. Therefore, to avoid this problem it is recommended that, at least initially shape files and dbf files are held on the root drive of your PC.

7
P.Clegg, ArcPad (forms) ver.1 28/07/2003

Creating forms using ArcPad Studio 1. Open ArcPad Studio and click the New Layer Definition button on the toolbar. 2. Navigate to the file Bedding.shp. 3. Click the Open button. A new layer definition file is created with the <ArcPad> root element and <LAYER> child element.

4. Double-click <LAYER> in the Tree View to set the properties of the layer definition file.

5. Type Bedding in the Name text box and click OK. 6. Notice the name attribute is added to the <LAYER> element in the Tree View.

8
P.Clegg, ArcPad (forms) ver.1 28/07/2003

7. Click the Save button on the toolbar to save the layer definition file. In general, its a good idea to save your file periodically while editing, just in case something unexpected happens. Create an edit form

8. Click the Forms button on the toolbar. This opens the Forms dialog box, which displays a list of all the forms defined in the layer definition file.

9. Click the EDITFORM button. 10. Click the Form menu and click Form Properties.

9
P.Clegg, ArcPad (forms) ver.1 28/07/2003

11. The Form Properties dialog box is displayed. Type Bedding in the Caption text box. Do not change any of the other default values. Ensure that all the check boxes are filled.

12. Click OK. Notice the form caption changes to Bedding If required it is possible to add pages to a form. Simply click on the Page menu and click Add Page. 13. To name a page, click the Page menu and click Page Properties, the Page properties dialogue box will appear. 14. Type bedinfopage in the Name text box. 15. Type Bedding Data in the Caption text box

10
P.Clegg, ArcPad (forms) ver.1 28/07/2003

16. Click OK 17. Your form should now look like this

Adding controls to the form A selection of different controls are available the following table shows the controls and their basic properties. Each control has a set of attributes that define it, which are listed in the Control Properties dialog box. For example, the X and Y attributes of a control determine the control's location on the form. Each control also has a set of properties and methods that are used to retrieve information about the control or modify various aspects of the control at run-time, via scripts. In addition, some controls generate a range of events as they are operating, and scripts can be called when these events occur. For example, a Button control generates an OnClick event each time it is clicked. A script can be associated with this event, allowing the form to perform custom actions such as the calculation of one control value based on the values of other controls. The use of scripts is not covered in this guide.

11
P.Clegg, ArcPad (forms) ver.1 28/07/2003

1. Add a Label control. Hold your mouse pointer over the LABEL button in the Control Palette , then click and drag the control onto the form. 2. The Control Properties dialog box for the new Label control is displayed after you drop the control. This is where you'll define the Label control's attributes, such as its name, caption, and location on the form. 3. In the Name text box, type slblFormation. Later in this tutorial, you'll see how to use a control's name to identify it in scripts. 4. In the Caption text box, type Formation. This is what gets displayed to users on the form. 5. Set the size and location of the Label control. Type 4 and 4 in the X and Y text boxes, respectively. Then type 40 and 12 into the Width and Height text boxes, respectively. You can also set the size and location of controls by dragging and sizing with your mouse, but this approach is more precise

6. Click OK to finish adding the new control to your edit form.

12
P.Clegg, ArcPad (forms) ver.1 28/07/2003

7. Next we'll add a ComboBox control that will be bound to an attribute field in the Bedding.shp DBF table. When a user sets the value of a bound control in ArcPad, the value gets written to the attribute that it is bound to in the shapefile table. This happens automatically. Hold your mouse pointer over the COMBOBOX button in the Control Palette, then click and drag the control onto the form. 8. Set the attributes for the ComboBox in the Control Properties dialogue box as shown in the figure below.

9. Click on the List Values tab of the Control Properties dialogue box. 10. Under External List Values, click on Browse and navigate to the Forname.dbf file.

13
P.Clegg, ArcPad (forms) ver.1 28/07/2003

11. In the Values Field select Name. (If Value is selected then the number in the Value column of the dbf file is recorded in the attribute table rather than the name of the formation, strike, dip or dip direction. For example the Forname.dbf shown on page 7, would record 1 in the attribute table if Basal Snd had been selected on the form). 12. In the Text Field select Name. 13. If you wish to limit entries to only those in the dbf file, check Limit to list. If you wish to be able to add other entries leave unchecked. 14. Click OK. 15. Repeat stages 1-14 to add Labels and ComboBoxes for Strike, Dip and Dip direction. Remember to change the X & Y for each new label and box, the entry in the Name text box of the Control Properties dialogue box for each new ComboBox e.g. cboDip etc. and also to assign the correct dbf file for each. 16. Your edit form should now look something like this

17. Now we will add Label and Edit controls for bed thickness. 18. Drag a Label control onto the edit form and define the Label controls attributes in the Control Properties dialogue box as shown below. 19. Click Ok 14
P.Clegg, ArcPad (forms) ver.1 28/07/2003

20. Add an Edit control shown below. 21. Click Ok

from the Control Palette and define its attributes as

22. Add another Label control for the date and define its attributes as shown below. 23. Click OK

15
P.Clegg, ArcPad (forms) ver.1 28/07/2003

24. Finally add a Date Time 25. Click OK

control and define its attributes as shown below

26. The form is now complete and should look something like this.

16
P.Clegg, ArcPad (forms) ver.1 28/07/2003

27. Click on OK 28. Click the Save button on the toolbar. 29. Exit ArcPad Studio. Checking the form 1. Open ArcPad on your PC 2. Click Add Layer and add Bedding.shp.

3. Click Layers 4. Select Bedding and check the edit checkbox

5. Click to close the Layers dialogue box. 6. The Edit toolbar should be activated.

17
P.Clegg, ArcPad (forms) ver.1 28/07/2003

7. Click on the Capture Point feature button. 8. The arrow pointer is replaced by a cross. Click on the Map area of the display and a point will appear along with the Bedding form.

9. Click on each of the drop down boxes in turn t check that it is working o correctly 10. The form also displays the Attribute table and the Geography. Use the arrows to scroll to the required tab and click on it to view the contents of that page. 11. Click Cancel and exit ArcPad without saving. 12. Youve now created your form. 13. It is worthwhile checking your forms before going out in the field to make sure that they function correctly and record data in the attribute table in the correct format. This can be done by adding data using your forms and then opening the relevant shapefiles in ArcGis and looking at the attribute table for each.

18
P.Clegg, ArcPad (forms) ver.1 28/07/2003

Creating forms using the Form Creation Wizard Another way of creating forms is to use the From Creation Wizard (see appendix for details). This applet generates custom data entry forms for your shapefile on-the-fly from within ArcPad. You select a shapefile and the wizard walks you through the process of defining your custom data entry form. You can set options for each field such as default values, required and read-only fields, and minimum and maximum values. You can also create pick lists. These forms can be further customized in ArcPad Studio if desired. Unless you have to create a form in the field it is recommended that forms are created in ArcPad Studio or ArcPad on your desktop/laptop. For the purposes of this exercise the layer definition file Bedding.apl created previously should be deleted or

moved

. The Form Wizard will overwrite the pre-existing apl file

1. Ensure that the form wizard is i nstalled (see appendix). 2. Open ArcPad. Ensure that the Form Wizard is visible on the toolbar. If it isnt click on the Tools button Toolbars | tlbToolBrowser

3. Click to add a layer. 4. Navigate to Bedding.shp and check the tick box 5. Click OK 6. Click on the Layer button below. and check the Bedding shapefile as shown

19
P.Clegg, ArcPad (forms) ver.1 28/07/2003

7. Click

to close the Layers Dialogue box.

8. Click on the Forms Wizard button. 9. The Select Shapefile dialogue box opens, select Bedding.shp. 10. Click OK

11. The Select fields to include dialogue box opens.

20
P.Clegg, ArcPad (forms) ver.1 28/07/2003

12. If you wish to add all the fields listed click

. If you wish to add or remove and buttons

fields individually highlight the field and use the respectively. 13. Add all but the Id fields.

14. The order in which the fields appear on the form can be altered by highlighting the field and using the up/down button. Place the fields in the same order as shown below.

15. Click OK 16. The Date field dialogue box opens. This shows that it is the first of seven fields. Ensure that the Include this field in form box is checked and also that the Use the current date as default box is also checked. 17. Click OK

21
P.Clegg, ArcPad (forms) ver.1 28/07/2003

18. The next filed form appears Text Field: Formation. 19. Again check the Include this field in the form box. 20. If you wish to set a default value enter it into the space provided: Enter Unknown.

21. Click on the Pick List tab. 22. There are two options here. Either Enter pick list values manually or Use a DBF table for the pick list. 23. In this case we will enter the pick list values manually, so check the appropriate box. 24. Two additional text boxes appear Value and Text. 25. In the Value text box type 1. 26. In the Text text box type Basal Snd. 27. Click Add 28. The information is shown in the display box. 29. Repeat stages 25 -27 with the values: 2, 3, 4, 5, 6, 7, 8, and the text : Marl Slt, Raisby, Ford, Conc. Lim, Roker, Seaham, Unknown. 30. Click OK.

22
P.Clegg, ArcPad (forms) ver.1 28/07/2003

31. The next field form appears; Numeric field: Strike. 32. Check the Include this field in the form box. 33. In the Default value text box enter 999

34. Click on the Pick List tab and check the Use a DBF table for the pick list box. 35. Click on the button to navigate to the strikevalues.dbf file. 36. Set the Value Field to VALUE and the Text Field to STRIKE. 37. Click OK 38. Continue this process until all the field forms are completed. The following message should appear.

23
P.Clegg, ArcPad (forms) ver.1 28/07/2003

39. Click Yes. 40. To view the form, the bedding shapefile must be in edit mode. 41. Click on the Layer box. button and check the edit box in the Layer dialogue

42. Click on to close the Layers dialogue box. 43. The Edit toolbar should be activated.

44. Click on the Capture Point feature button. 45. The arrow pointer is replaced by a cross. Click on the Map area of the display and a point will appear along with the Bedding form.

24
P.Clegg, ArcPad (forms) ver.1 28/07/2003

46. Click on each of the drop down boxes in turn to check that it is working correctly 47. Click Cancel and exit ArcPad without saving. 48. Youve now created your form. You will notice that unlike the form created in ArcPad Studio there is no Attribute or Geography tab on this form. This means that data cannot be edited. However, as mentioned at the beginning of this section, forms created using the wizard can be edited within ArcPad Studio. 1. Start ArcPad Studio 2. Click on the New Layer Definition button. 3. In the Choose Layer Shapefile dialogue box navigate to Bedding.shp and click Open. 4. Double click <EDITFORM>Bedding.shp in the Bedding.apl dialogue box.

5. The Bedding.shp Edit Form will appear along with the controls palette

25
P.Clegg, ArcPad (forms) ver.1 28/07/2003

6. Click on Form | Form Properties. 7. You will notice that the Attributes Page and Geography Page boxes are unchecked. Check both and click OK.

8. It is possible to edit any of the attributes and controls that you created using the Form Wizard by following the instructions in the previous section. 9. Click on OK and close the Bedding.apl window saving the changes y have ou made. 10. Exit ArcPad Studio. 11. Check the form again in ArcPad as outlined previously. 12. You will notice that the Attribute page and Geography page are now available. 13. This now means that the data in the Attribute table is editable.

26
P.Clegg, ArcPad (forms) ver.1 28/07/2003

Appendix
Useful Addresses ESRI (owners of the ArcGis suite of applications) http://www.esri.com/ ArcPad web page http://support.esri.com/products/default.asp?p=7 ArcPad Form creation wizard download site http://arcscripts.esri.com/details.asp?dbid=12608 Installing the Form Creation Wizard 1. Download the form wizard zip file from the site shown in Useful Addresses. 2. Extract the files to the Applets folder within the ArcPad program folder. 3. Open ArcPad 4. The Form Wizard icon should be visible on a toolbar 5. If it isnt click on Tools | Toolbars | tlb ToolBrowser. 6. If a yellow ? appears on the toolbar you will need to upgrade ArcPad to v. 6.0.1 People using ArcGis, ArcPad & GPS in the department Dr. Ken McCaffrey (k.j.w.mccaffrey@durham.ac.uk) Dr. Phillip Clegg (p.clegg@durham.ac.uk) Robert (Woody) Wilson (robert.wilson@durham.ac.uk )

27
P.Clegg, ArcPad (forms) ver.1 28/07/2003

You might also like