Private Sub Form_Load()
Data1.data source=" & App.Path & "\Pro5.mdb"
Data1.RecordSource = "select * from Customer"
End Sub
Private Sub cmdSave_Click()
name1 = txtName.Text
address1 = txtAddress.Text
number1 = txtNumber
bought1 = txtBought.Text
Data1.Recordset.addnew
Data1.Recordset.Fields("Cust_Name") = name1
Data1.Recordset.Fields("Cust_Address") = address1
Data1.Recordset.Fields("Cust_Number") = number1
Data1.Recordset.Fields("Cust_Bought") = bought1
Auto1 = Data1.Recordset.Fields("code")
Data1.Recordset.Update
End Sub
'the file Pro5.mdb is in the same folder as the forms and other files of VB 6. i want when i click on the command button, the information like name1, address1, number1, bought1 are being saved in the database file Pro5.mdb, but with the actual code that i have written it don't work and i think the problem is found in the Private Sub Form_Load(), as the code for the source is not correct.
thanks, for paying attention to the my problems
Joyz

New Topic/Question
Reply




MultiQuote






|