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

  1. Form1
  2. Product Information
  3. Form1
  4. Label1
  5. Item:
  6. Label2
  7. Price:
  8. Price
  9. Label3
  10. Qty in Stock:
  11. Product
  12. DBENGINE
  13.     TopButton
  14. NextButton
  15. BottomButton
  16. Bottom
  17. PreviousButton
  18. Previous
  19. MNU_File
  20. &File
  21. MNU_Create
  22. &Create Product Database
  23. MNU_Quit
  24. &Quit
  25. Form_Click
  26. @    Form_Load
  27. Product6
  28.     TableName
  29. IndexID
  30. SaveEveryChange
  31. False
  32. Action
  33.     OpenTable
  34. Form_Unload
  35. Cancel
  36. CloseTableK
  37. MNU_Quit_Click*
  38.     GetRecordo
  39. FillFormF
  40.     FieldName
  41. GetField
  42. FieldValued
  43. Price
  44. Command1_Click
  45. FirstRecord
  46. Command2_Click
  47. LastRecord
  48. Command3_Click
  49. NextRecord
  50. Command4_Click
  51. PreviousRecord#
  52. Command5_Click5
  53. PutField
  54. InsertRecord
  55. Reaction
  56. Command6_Click
  57. UpdateRecord
  58. @    FillCombo
  59. Item_Change
  60. SearchMode
  61. SearchFirst/
  62. SearchField
  63. Item_LostFocus
  64. Item_Click
  65. TopButton_Clickj
  66. BottomButton_Click
  67. NextButton_Click
  68. PreviousButton_Click
  69. DTBL_Error
  70. Customer
  71. DataTable_Error
  72.     ErrorCode
  73. DBENG_Error
  74. MNU_Create_Click
  75. NFields}
  76. TableFieldNames
  77. TableFieldTypes
  78. CreateTable
  79. IndexNFields
  80. CreateIndex
  81. Fill_Database
  82.     TableType
  83.     Paradox40
  84. Form_Load
  85. Here we set up the DataTable - Table parameterso
  86. Note - Here is the PRODUCT database table structure:
  87.    FIELD
  88.  FIELD TYPE 
  89.    Item
  90.  A50 
  91.    Price
  92.    Qty
  93. Note key fields are marked with an *..
  94. Also note that this program expects the PRODUCT database
  95. (PRODUCT.DB and PRODUCT.PX) to be located on drive C
  96. in the root directory.
  97. C:\PRODUCT
  98. Specify database table name.
  99. Open with all indexes.
  100. Buffer data to disk.
  101. Open up the tableT
  102. Fill the combo box on the form
  103. with products from the database.
  104. in the field Item.
  105. Fill the form.
  106. Form_Unload
  107. MNU_Quit_Click
  108. FillForm
  109. Fill in the form with a record from the database
  110. Get the first record
  111. Item field
  112. Get the field value
  113. Place in the combo box
  114. Price"
  115. Price fieldo
  116. Get the field valuel
  117. Place in text box
  118. Qty field 
  119. Get the field value
  120. Place in text box'
  121. FillCombo
  122. Here we have some code to fill a Visual Basic Combo boxx
  123. With products from our database. We will be placing itemss
  124. from the datatbase into our combo box using the AddItem method
  125. Get the record
  126. Error handlerF
  127. Field in the database with the items
  128. to place in the combo boxn
  129. Move to the first record in the database..
  130. Loop to place all items in combo box. Loop while no DataTable error.
  131. Get the record
  132. Get the field value 
  133. Add it to the combo box list
  134. Move to next recordt
  135. Done now move back to the first record. 
  136. Item_Click
  137. Item not found!"
  138. TopButton_Click
  139. Move to the first record in the table
  140. Fill the form 
  141. BottomButton_Click
  142. Move to the last record in the table
  143. Fill the form 
  144. NextButton_Click
  145. Move to the next record 
  146. Fill the form 
  147. PreviousButton_Click
  148. Move to the previous recordv
  149. Fill the form 
  150. DBENG_Error
  151. Error code:"
  152.  -Drive not ready!
  153. Error code:"
  154. -End of table!
  155. Error code:"
  156. -Start of table!
  157. Error code:"
  158. -Table not found!"
  159. Error code:"
  160. -Unknown error!"
  161. MNU_Create_Click
  162. We will create the Product table here in the root directory on drive C
  163. C:\Product
  164. Item,Price,Qty
  165. A50,$,S"
  166. Now create the primary index
  167. C:\Product
  168. Fill_Database
  169. This function fills in the C:\PRODUCT database with a few itemss
  170. in order to have records to fill the combo box..
  171. Place the first item, price and Qty in the databasee
  172. VGA Monitor"
  173. Price"
  174. 245.00
  175. Insert a new record
  176. Place the second item, price and Qty in the database
  177. EGA Monitor"
  178. Price"
  179. 145.00
  180. Insert a new record 
  181. Place the third item, price and Qty in the database   
  182. CGA Monitor"
  183. Price"
  184. 145.00
  185. Insert a new record 
  186. Place the fourth item, price and Qty in the database
  187. Keyboard/101 key/AT Style"
  188. Price"
  189. 55.00"
  190. Insert a new record
  191. Place the fifth item, price and Qty in the databasee
  192. Mouse/serial
  193. Price"
  194. 35.00"
  195. Insert a new record
  196.