home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / db3v / demo3.frm (.txt) < prev    next >
Visual Basic Form  |  1993-10-03  |  10KB  |  226 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. LastRecord
  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_Click5
  96. MNU_SearchLast_Click
  97. CustomerQ
  98. AccountNumber
  99.     TableName
  100. IndexID
  101. SaveEveryChange
  102. False
  103. AccountNumber_Change
  104. AccountNumber_LostFocus
  105. SearchMode
  106. SearchFirst
  107. SearchField
  108. AccountNmberT
  109.     KeySearch
  110.     SearchKeyz
  111. DBENG_Error
  112. FormToRecord
  113. MNU_Create_Click
  114. NFieldsg
  115. TableFieldNames
  116. TableFieldTypes
  117. CreateTable
  118. IndexNFields
  119. CreateIndex
  120.     TableType
  121.     Paradox40
  122. Form_Load
  123. C:\CUSTOMER"
  124. Form_Unload
  125. FillForm
  126. Here we wish to develop a subroutine that fills in our
  127. Address Book form with the information present in thee
  128. current record of our database
  129. Notice that this Subroutine is not position dependentt
  130. It always fills in the form with the information present
  131. in the current record.
  132. We will use other routines to move around in the databasee
  133. table. We can then call this routine to fill in our form..
  134. This routine is reusable!!
  135. Get the current record. 
  136. Account Number
  137. Last Name"
  138. First Name
  139. Middle Initial
  140. Address"
  141. State"
  142. Phone"
  143. Notes"
  144. TopButton_Click
  145. This code will make the current record the first recordd
  146. in the table.
  147. It will then fill our form with the data present in thee
  148. first record..
  149. ClearButton_Click
  150. Here we simply clear all the fields on the form.
  151. There are no database specific routines involved here.
  152. InsertButton_Click
  153. This subroutine inserts a record into our database.t
  154. Transfer info from form to current record.
  155. Insert the record 
  156. If an error 
  157. UpdateButton_Click
  158. This subroutine updates a record in our database.
  159. Transfer info from form to record 
  160. Update recordf
  161. if error
  162. BottomButton_Click
  163. NextButton_Click
  164. PreviousButton_Click
  165. DeleteButton_Click
  166. MNU_Quit_Click
  167. AccountNumber_LostFocus
  168. This LostFocus routine is used to search the
  169. database table's primary key for a specific user supplied
  170. Account Number. If the Account Number the user suppliess
  171. is not found in the database table, the form is cleared,
  172. the user supplied Account Number is placed back into the
  173. Account Number field, and we will assume that we are enteringg
  174. a new account.
  175. Temporary variable to hold user typed Account Number
  176. Save user supplied Account Number in Temp var.
  177. Account Number
  178. We will search for a value in Account Number field.
  179. We will search for the value the user enteredu
  180. Submit the search criteria by placing the 
  181. value to be searched for into the DataTablev
  182. custom control's record buffer. 
  183. We will search the primary index which consistsc
  184. of one field (Account Number) the 1st field in
  185. the database table.n
  186. We will search for the first match
  187. starting at the first record in the table.
  188. Begin search
  189. Search failed to find a match, clear the forms
  190. Restore user supplied Account Number
  191. Begin to process new account infor
  192. Search was successfull, get the record
  193. Fill in the form with the informationl
  194. DBENG_Error
  195. Error code:"
  196. -End of table!
  197. Error code:"
  198. -Start of table!
  199. Error code:"
  200. -Unknown error!"
  201. FormToRecord
  202. This subroutine transfers the information present in the
  203. Customer Information form to the database's current record.d
  204. Account Number
  205. Target database field 
  206. Target field value
  207. Place it in the Accountm
  208. Number field in thei
  209. current record. 
  210. Do the same three-step process for each remaining field in the Customer
  211. Information form.-
  212. Last Name"
  213. First Name
  214. Middle Initial
  215. Address"
  216. State"
  217. Phone"
  218. Notes"
  219. MNU_Create_Click
  220. We will create the CUST table here in the root directory on drive CC
  221. C:\CUST"
  222. Account Number,Last Name,First Name,Middle Initial,Address,City,State,Zip,Phone,Notes"
  223. N,A30,A20,A1,A50,A30,A2,A10,A14,M200
  224. Now create the primary index
  225. C:\CUST"
  226.