home *** CD-ROM | disk | FTP | other *** search
/ Computer Based Training: …, Windows 95 & NT Basics / a1454501.iso / mo97a02 / IA01.TXT < prev    next >
Encoding:
Text File  |  1997-05-08  |  15.8 KB  |  379 lines

  1. A form, printed or online, is often the primary interface between you and your clients.
  2. |
  3. Access recognizes this by allowing you to enhance your data presentation and automate your data updating.
  4. |
  5. Using a form, you can gather related information, for example about suppliers.
  6. |
  7. Instead of searching various tables, you can gather all the information and display it in a single form.
  8. |
  9. You can control and enhance the way your data displays, both on screen and in print.
  10. |
  11. For example, you can add shading to improve the appearance of the form.
  12. |
  13. You can display pictures and graphs directly on the form.
  14. |
  15. This is useful when you want to emphasize points, and inform clients about sales trends, future developments, or issues of special interest to your business.
  16. |
  17. You click the ^UForms^u tab in the Database window to see the list of available forms.
  18. |
  19. Let's look at the Products form in the Database window.
  20. |
  21. If you click ^UDesign^u, the selected form opens in Design view.
  22. |
  23. You can alter or modify a form's structure in Design view.
  24. |
  25. Clicking the ^UNew^u button lets you create a new form.
  26. |
  27. Access opens the New Form dialog box in which you can choose to build a form without a wizard or to activate any of the available Form wizards to assist you.
  28. |
  29. Let's say you want to enter data in an existing form, Products.
  30. |
  31. You select the form, and then you click ^UOpen^u.
  32. |
  33. Right-clicking ^UProducts^u, and selecting ^UOpen^u has the same result.
  34. |
  35. The initial default Form Window view for Access is Form view.
  36. |
  37. You can view, change, or delete form data in this view.
  38. |
  39. You click the ^UView^u button to see all the fields in the form arranged in a datasheet.
  40. |
  41. Then you select ^UDatasheet View^u from the drop-down list.
  42. |
  43. Access displays all the fields in the form arranged in a datasheet.
  44. |
  45. Depending on the number of records, you may find that they scroll off the screen.
  46. |
  47. When each record you want to display in a form contains a lot of information, you can design a ^Rmultiple^r ^Rpage^r form.
  48. |
  49. You use the record number box and the buttons in the bottom left-hand corner to view the first page of information for record.
  50. |
  51. ^RContinuous^r forms are useful for browsing through a list of records when each record has only a few fields.
  52. |
  53. Rather than showing you one record at a time, a continuous form displays formatted records back-to-back, much like a datasheet.
  54. |
  55. Access also provides a special type of form, called a ^Rmodal^r form, that requires a response before you can continue working.
  56. |
  57. An example of a modal form is a specially designed option dialog box which allows you to choose between various options.
  58. |
  59. A modal form is the same as a modal message box - you can't do anything else in Access until you've responded to it.
  60. |
  61. Generally forms are designed so that you can insert a new record, change fields, or delete records in Form view or in Datasheet view.
  62. |
  63. Let's suppose that you want to enter a new record in the Products form.
  64. |
  65. The way you enter a new record varies, depending on how you have designed the form.
  66. |
  67. To open the Products form, you double-click it.
  68. |
  69. You click the ^UNew record^u button to enter a new record.
  70. |
  71. Or choosing ^UEdit - Go To - New Record^u takes you to a new record.
  72. |
  73. As soon as you enter new data in a record that has an AutoNumber as its primary key, Access automatically assigns a new number to the primary key field.
  74. |
  75. You enter the name of the new product in the Name field, and press the ^UTab^u key to move to the next field.
  76. |
  77. The pencil icon in the top left-hand corner of the record indicates that the data is being updated.
  78. |
  79. You enter the relevant data in the Category ID and Unit Price fields.
  80. |
  81. Then you click the ^UView^u button and select ^UDatasheet View^u.
  82. |
  83. Access displays the new record.
  84. |
  85. You can also change or delete existing data in a form.
  86. |
  87. To do this you select the record you want to delete, record number 5 in this case.
  88. |
  89. You can choose ^UEdit - Delete^u to delete the record.
  90. |
  91. Access warns you of the implications of deleting the record, and asks you to confirm that you indeed want to delete it.
  92. |
  93. You click ^UYes^u.
  94. |
  95. Access then removes the record.
  96. |
  97. When you use forms to display and edit your data, you can search for data and sort it in a new order.
  98. |
  99. When you specify a sort order in Form view or Datasheet view, you can sort all records in ascending or descending order (not both).
  100. |
  101. Let's say you want to sort your customers' names in alphabetical order.
  102. |
  103. You sort the Customers form in Datasheet view using the ^UQuick Sort^u command.
  104. |
  105. First, you click the ^UCompany name^u heading.
  106. |
  107. You click the ^USort Ascending^u button on the Standard toolbar.
  108. |
  109. Access automatically sorts the selected field in alphabetical order.
  110. |
  111. Regardless of where you specify the sort order, Microsoft Access saves the sort order when you save the form or datasheet.
  112. |
  113. When you open the form again, the data is displayed in the sort order in which it was last sorted.
  114. @@
  115. Access also allows you the change the criteria by which records are filtered. For example, let's say you want to see a list of employees from different departments.
  116. |
  117. You click the ^UFilter by Form^u button to filter a form by new criteria.
  118. |
  119. Choosing ^URecords - Filter - Filter by^u ^UForm^u or right-clicking the active form, and selecting ^UFilter by Form^u has the same effect.
  120. |
  121. Then you select ^UDepartment Name^u, and you choose ^UMarketing^u in the drop-down list box.
  122. |
  123. You can enter one criterion, and then click the ^UOr^u tab at the bottom of the screen to enter additional criteria.
  124. |
  125. For example, you may want to see the marketing employees as well as the shipping clerks.
  126. |
  127. If you don't like any of the criteria you've entered, you click the ^UClear^u ^UGrid^u button to start over.
  128. |
  129. When you are satisfied with the filter, you click the ^UApply Filter^u button.
  130. |
  131. Access returns only those employees who work as shipping clerks in the Marketing department or whose job title is shipping clerk.
  132. |
  133. To remove the filter you simply click the ^URemove Filter^u button.
  134. |
  135. Choosing ^URemove Filter/Sort^u command from the ^URecords^u menu also has the same result.
  136. |
  137. Excel removes the filter that you've applied.
  138. @@
  139. Access includes features such as AutoForm and the Form Wizard which allow you to create and design forms quickly and easily.
  140. |
  141. For example, the AutoForm facility and the Form Wizard enable you to get a jump-start on creating and designing forms.
  142. |
  143. Suppose you want to create a simple form that will allow employees to verify their personal details.
  144. |
  145. The quickest way to do this is to create an Employees form using the AutoForm facility.
  146. |
  147. You can also create a form based on a query.
  148. |
  149. In the Database window, you click the ^UTables^u tab.
  150. |
  151. Then you click the arrow next to the ^UNew Object^u button on the toolbar, and you choose ^UAutoForm^u.
  152. |
  153. Access automatically builds the form, and gives it the same name as the table you initially selected.
  154. |
  155. All the fields from the selected table are included in the new form.
  156. |
  157. You cannot include fields from another table when you create a form this way.
  158. |
  159. The AutoForm facility is useful for situations where you are not concerned with appearance but with functionality.
  160. |
  161. An AutoForm also serves as a good starting point for a basic form which you can then customize to your specific needs.
  162. |
  163. Much like any form in Access, it can be opened in Design view, formatted, and modified.
  164. |
  165. Suppose you want to build an orders form to be sent to your customers.
  166. |
  167. The Form Wizard gives you more control over the appearance and layout of a form.
  168. |
  169. You click the ^UNew Object^u button.
  170. |
  171. Then you select ^UForm^u in the drop-down list.
  172. |
  173. The wizards and AutoForms available in the New Form dialog box enable you to build forms quickly.
  174. |
  175. For example, the Chart Wizard builds a form containing a graph object.
  176. |
  177. You select a data source for your form by changing the table or query name displayed in the list box.
  178. |
  179. You select ^UForm Wizard^u, and then you click ^UOK^u.
  180. |
  181. In the Form Wizard dialog box, you can select any field in the Available Fields list by double clicking it.
  182. |
  183. To choose a highlighted field, you click the single right arrow.
  184. |
  185. You can also include fields from other related tables by changing the selection in the Table/Queries list box.
  186. |
  187. If you copy the wrong field, you select it in the Selected Fields field, and click the single left arrow to remove it.
  188. |
  189. You can remove all fields and start over by clicking the double left arrow button.
  190. |
  191. Here you click the double right arrow to include all the Orders fields in the new form.
  192. |
  193. You click ^UNext^u.
  194. |
  195. Access gives you a number of form layouts to choose from.
  196. |
  197. You can choose to display the controls on your form as the default setting, "columnar".
  198. |
  199. You can also choose to arrange the controls across the form in a tabular format which will create a continuous form.
  200. |
  201. Alternatively you could choose the Datasheet format.
  202. |
  203. The last available option is Justified format.
  204. |
  205. In this case, you select the ^UColumnar^u radio button, and then you click ^UNext^u.
  206. |
  207. Now you have to choose the style you want your form to appear in. You are shown a sample view of each selection you make in the left pane.
  208. |
  209. This time, you select ^UStone^u.
  210. |
  211. Then you click ^UNext^u.
  212. |
  213. The last step is to enter an appropriate title. 
  214. |
  215. If you click the ^UModify the form's^u ^Udesign^u radio button, Access takes you into Design view.
  216. |
  217. Here, you choose ^UOpen the form^u ^Uto view or enter information^u.
  218. |
  219. You click ^UFinish^u to go directly to Form view.
  220. |
  221. The new Orders form is displayed.
  222. @@
  223. @@
  224. You may sometimes need to display from your database in more complex relational manner than is possible using a standard form.
  225. |
  226. You may, for example, want to bring together data from various tables and queries.
  227. |
  228. Using subforms, you can combine information so that you don't have to switch between separate tables or forms.
  229. |
  230. You can create an outer form or main form in the usual way using the Form Wizard, and then embed a subform in it.
  231. |
  232. In most cases, the subform is linked to the main form, so it shows records that are related to the current record on the main form.
  233. |
  234. For example, this subform shows data from an Orders table and a Customers table.
  235. |
  236. Links between a main form and a subform have to meet two conditions.
  237. |
  238. The main form should be based on a table or a query with a primary key.
  239. |
  240. The subform should be based on a table that contains a field with the same name or value as the primary key field in the main form.
  241. |
  242. The main form is based on the Customers table, so the first condition is met.
  243. |
  244. The subform meets the second condition because it is based on the Orders table that also has a Customer ID field.
  245. |
  246. If the two conditions for linking a main form and a subform are not met automatically, you can still link the forms manually.
  247. |
  248. But there must be a field in the underlying table for the main form that has values in common with a field in the underlying table for the subform.
  249. |
  250. This is called a "one-to-many" relationship.
  251. |
  252. The data in the Customers table is the "one" side of the relationship.
  253. |
  254. The data in the Orders table is the "many" side of the relationship since each customer will generally order more than once.
  255. |
  256. The main form and subform are linked so that the subform displays all the related rows from the linking table.
  257. |
  258. For example, where the main form displays the customer's details, the subform displays order details.
  259. |
  260. You can use the navigation buttons in Form view to go to the next customer record.
  261. |
  262. If you need to make a change to a record, you only need to alter it in one place, in a subform for example.
  263. |
  264. Let's say that a vendor name is changed from Southern Distribution to Solution Technologies.
  265. |
  266. To update the entire database on this change, you simply use the Orders/Customers subform to change the company name.
  267. |
  268. You save the change, then switch to the Customers table to test the change.
  269. |
  270. Access reflects the change you made in the subform.
  271. |
  272. A subform can be displayed as a datasheet, or it can be displayed as a single or continuous form.
  273. |
  274. A main form can only be displayed as a single form.
  275. |
  276. It can have any number of subforms if you place each subform on the main form.
  277. |
  278. You can also nest up to two levels of subforms.
  279. |
  280. For example, you could have a main form that displays customers, a subform that displays orders, and another subform that displays order details.
  281. @@
  282. The easiest way to create a form with a subform is to use the Form Wizard.
  283. |
  284. The Form Wizard builds both forms and makes them work together.
  285. |
  286. Lets say that you want to build a form based on the Customers table.
  287. |
  288. On the main form you also want to indicate the total value of orders placed by the customer.
  289. |
  290. The main form is based on a Customers table.
  291. |
  292. You also want to create a subform based on a query which contains the customer's order details that you want displayed on the subform.
  293. |
  294. Both forms have a Customer ID field which means that Access is able to link the two forms automatically.
  295. |
  296. In the database window, you click the ^UForms^u tab to display the list of forms.
  297. |
  298. You click the ^UNew^u button.
  299. |
  300. Then you double-click the ^UForm Wizard^u option in the New Form dialog box.
  301. |
  302. In the Tables/Queries drop-down listbox, you select ^UTable: Customers^u.
  303. |
  304. You then select ^UCompanyName^u, ^UCustomerID^u, and ^UPhone^u to display them in the Selected Fields list box.
  305. |
  306. In the Tables/Queries list box, you select ^UQuery: Order Subtotals^u.
  307. |
  308. You double-click ^UOrderID^u and ^USubtotal^u.
  309. |
  310. Then you click ^UNext^u.
  311. |
  312. You select the ^UForm with^u ^USubform(s)^u radio button, and then you click ^UNext^u.
  313. |
  314. You select ^UDatasheet^u as the layout for your subform, and you click ^UNext^u.
  315. |
  316. Access allows you to select a style for your form, ^UStone^u for example.
  317. |
  318. You click ^UNext^u.
  319. |
  320. You give the form an appropriate title.
  321. |
  322. Then you click the ^UFinish^u button to close the Form Wizard dialog box.
  323. |
  324. Access saves both the main form and the subform.
  325. |
  326. As your business needs change, you can modify your forms to suit your requirements.
  327. |
  328. For example, you may have a Products Form which you are using more frequently than before.
  329. |
  330. To avoid having to switch between forms and tables, you can add a subform which shows the manufacturer's details for each product they supply.
  331. |
  332. You select the form and then you click ^UDesign^u.
  333. |
  334. If the Toolbox is not visible, you click the ^UToolbox^u button to display it.
  335. |
  336. You click the ^USubform/Subreport^u button.
  337. |
  338. Then you drag the crosshair to the size you want for the subform.
  339. |
  340. In the Subform/Subreport Wizard dialog box, you can choose between creating a subform from another form, or creating it from a table.
  341. |
  342. You click the ^UTable/Query^u radio button to use the Manufacturers table in the subform.
  343. |
  344. Then you click ^UNext^u.
  345. |
  346. In the Tables and Queries list box, you select ^UManufacturers^u.
  347. |
  348. In the Available Fields list you click the fields you want to appear in the subform.
  349. |
  350. Then you click ^UNext^u.
  351. |
  352. Access allows you to define the link between a main form and a subform or to choose from a list.
  353. |
  354. You click the ^UChoose from a list^u radio button.
  355. |
  356. Here, you select the link ^UShow^u ^UManufacturers for each record in^u ^UProducts using Product ID^u.
  357. |
  358. Then you click ^UNext^u.
  359. |
  360. You name the new subform you've created.
  361. |
  362. Then you click ^UFinish^u to close the dialog box.
  363. |
  364. Access creates the form you've built and saves it as a separate form.
  365. |
  366. You can open it by double-clicking the subform.
  367. |
  368. It opens in the default view.
  369. |
  370. Let's see what the subform looks like when embedded in the main form.
  371. |
  372. You double-click the main form. 
  373. |
  374. Access nests the Products/Manufacturers subform in the main form.
  375. @@
  376. @@
  377. The crosshair has been dragged to the appropriate site and the Subform/Subreport Wizard dialog box is displayed.
  378. @@
  379.