home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / db3v / demo2.frm (.txt) < prev    next >
Visual Basic Form  |  1993-10-03  |  10KB  |  227 lines

  1. Form1
  2. Customer Information
  3. Form1
  4. Label10
  5. Account Number:
  6. AccountNumber
  7. Label1
  8. Last Name:
  9. LastName
  10. Label2
  11. First Name:
  12.     FirstName
  13. Label3
  14. MiddleInitial
  15. Label4
  16. Address:
  17. Address
  18. Label5
  19. City:
  20. Label6
  21. State:
  22. State
  23. Label7
  24. Label8
  25. Telephone:
  26. Phone
  27. Customer
  28. DBENGINE
  29. Label9
  30. Notes:
  31. Notes
  32.     TopButton
  33. NextButton
  34. InsertButton
  35. Insert
  36. DeleteButton
  37. Delete
  38. BottomButton
  39. Bottom
  40. PreviousButton
  41. Previous
  42. UpdateButton
  43. Update
  44. ClearButton
  45. Clear
  46. MNU_File
  47. &File
  48. MNU_Create
  49. &Create Customer Database
  50. MNU_Quit
  51. &Quit
  52. Form_Click
  53. @    Form_Load
  54. AddressBookE
  55. Action
  56.     OpenTable
  57.     GetRecord
  58. FillForm
  59. Form_Unload
  60. Cancel
  61. CloseTable
  62.     FieldName
  63. GetField
  64. LastName
  65. FieldValue
  66.     FirstName@
  67. TopButton_Click
  68. FirstRecord
  69. InsertButton_Click
  70. PutField
  71. InsertRecord
  72. ClearButton_Click
  73. MiddleInitial
  74. UpdateButton_Click
  75. UpdateRecord4
  76.     InsertRec
  77.     UpdateRec
  78. Address
  79. State^
  80. Phone
  81. Notesv
  82. BottomButton_Click^
  83. LastRecordZ
  84. NextButton_Click
  85. NextRecord
  86. PreviousButton_Click
  87. PreviousRecord
  88. DeleteButton_Click
  89. DeleteRecord
  90. MNU_Quit_Click|
  91. DTBL_Error
  92. Reaction
  93. LastName_Change
  94. LastName_LostFocus
  95. MNU_SearchFirst_ClickK
  96. MNU_SearchLast_Click
  97. CustomerQ
  98. AccountNumber
  99.     TableName#
  100. IndexID
  101. SaveEveryChange
  102. False
  103. AccountNumber_Change
  104. AccountNumber_LostFocus<
  105. TempA
  106. SearchMode
  107. SearchFirst
  108. SearchField
  109. AccountNmber1
  110. DBENG_Error
  111. FormToRecord
  112. subroutine
  113. inserts
  114. recordS
  115. intof
  116. database
  117. MNU_Create_Click
  118. NFields
  119. TableFieldNames
  120. TableFieldTypes
  121. CreateTable
  122. IndexNFields
  123. CreateIndex
  124.     TableType
  125.     Paradox40
  126. Form_Load
  127. C:\CUSTOMER"
  128. Form_Unload
  129. FillForm
  130. Here we wish to develop a subroutine that fills in our
  131. Address Book form with the information present in thee
  132. current record of our database
  133. Notice that this Subroutine is not position dependentt
  134. It always fills in the form with the information present
  135. in the current record.
  136. We will use other routines to move around in the databasee
  137. table. We can then call this routine to fill in our form..
  138. This routine is reusable!!
  139. Get the current record. 
  140. Account Number
  141. Last Name"
  142. First Name
  143. Middle Initial
  144. Address"
  145. State"
  146. Phone"
  147. Notes"
  148. TopButton_Click
  149. This code will make the current record the first recordd
  150. in the table.
  151. It will then fill our form with the data present in thee
  152. first record..
  153. ClearButton_Click
  154. Here we simply clear all the fields on the form.
  155. There are no database specific routines involved here.
  156. InsertButton_Click
  157. This subroutine inserts a record into our database..
  158. Transfer info from form to current record.
  159. Insert the record 
  160. If an error 
  161. UpdateButton_Click
  162. This subroutine updates a record in our database.
  163. Transfer info from form to record 
  164. Update recordf
  165. if error
  166. BottomButton_Click
  167. NextButton_Click
  168. PreviousButton_Click
  169. DeleteButton_Click
  170. MNU_Quit_Click
  171. AccountNumber_LostFocus
  172. This LostFocus routine is used to search on thee
  173. Account Number field for a specific user suppliedd
  174. Account Number. If the Account Number the user suppliess
  175. is not found in the database table, the form is cleared,
  176. the user supplied Account Number is placed back into the
  177. Account Number field, and we will assume that we are enteringg
  178. a new account.
  179. Temporary variable to hold user typed Account Number
  180. Save user supplied Account Number in Temp var.
  181. Account Number
  182. We will search on the Account Number field.m
  183. We will search for the value the user enteredu
  184. Submit the search criteria by placing the 
  185. value to be searched for into the DataTablev
  186. custom control's record buffer. 
  187. We will search for the first match
  188. starting at the first record in the table.
  189. Begin search
  190. Search failed to find a match, clear the forms
  191. Restore user supplied Account Number
  192. Begin to process new account infor
  193. Search was successfull, get the record
  194. Fill in the form with the informationl
  195. DBENG_Error
  196. Error code:"
  197. -End of table!
  198. Error code:"
  199. -Start of table!
  200. Error code:"
  201. -Unknown error!"
  202. FormToRecord
  203. This subroutine transfers the information present in the
  204. Customer Information form to the database's current record.n
  205. Account Number
  206. Target database field 
  207. Target field value
  208. Place it in the Accounte
  209. Number field in thei
  210. current record. 
  211. Do the same three-step process for each remaining field in the Customer
  212. Information form.-
  213. Last Name"
  214. First Name
  215. Middle Initial
  216. Address"
  217. State"
  218. Phone"
  219. Notes"
  220. MNU_Create_Click
  221. We will create the CUSTOMER table here in the root directory on drive C
  222. C:\CUSTOMER"
  223. Account Number,Last Name,First Name,Middle Initial,Address,City,State,Zip,Phone,Notes"
  224. N,A30,A20,A1,A50,A30,A2,A10,A14,M200
  225. Now create the primary index
  226. C:\CUSTOMER"
  227.