I have small application that i was developing as a school evaluation project,but i have faced problems.(i.e) My command buttons are not perfoming the tasks as expected Edit, and Delete buttons they search and delete the first records on the database. A sample of the commands is as below i am using Using DAO in a module and listviews to display the records.Please helpPrivate Sub cmdEditer_Click()cmdsaved.Caption = "Update"Dim l As Integerl = Val(InputBox("Enter the suppliers Number to Edit", "Edit Suppliers"))Rela = "Select * from suppliers where supplier_No =" & l & ""getdata RelaIf Plot.RecordCount = 0 ThenMsgBox "Record Not Found", vbInformation, "Supplier"ElseIf Plot.RecordCount > 0 ThenCall getsuppliersMsgBox "Record Found", vbInformation, "Supplier"loadlv2End IfEnd Sub**************************************************************Private Sub cmdDelete_Click()Dim x As VariantDim f As IntegerIf MsgBox("Are you sure You Want to Delete This Record", vbYesNo, "Delete File") = vbYes ThenFor f = 1 To ListView1.ListItems.CountIf ListView1.ListItems(f).Checked = True Thenx = ListView1.SelectedItem.TextRelationship.Execute "delete * from Customer where Cust_No = " & x & ""End IfNext fMsgBox "Record has been deleted", vbCritical, "Delete.."End IfEnd Sub*****************************************************************Public Relationship As DAO.DatabasePublic Plot As DAO.RecordsetPublic Rela As StringPublic Sub opendb()Set Relationship = OpenDatabase(App.Path + "\Relationship.mdb")End SubPublic Sub getdata(ByVal source As String)opendbSet Plot = Relationship.OpenRecordset(source)End SubPublic Sub save(ByVal str As String)opendbRelationship.Execute strEnd Sub

 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions