We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Sub save_Collections(cn As ADODB.Connection, lpMyDoc As String, ACCTID As String, _ Amount As Double, UsrName As String, CustName As String) Call OPEN_CON(cn, "DBSALES", "Winpos") Dim rs As ADODB.Recordset Dim sql As String Set rs = New ADODB.Recordset sql = "select * from Collect where Docno='" & lpMyDoc & "'" rs.LockType = adLockOptimistic rs.CursorType = adOpenKeyset rs.Open sql, cn With rs If .BOF = True And _ .EOF = True Then .AddNew !docno = lpMyDoc End If !ACCTID = !ACCTID !Amount = !Amount - Amount !uname = !uname !Cust_Name = !Cust_Name .Update .Close End With Set rs = Nothing Set cn = Nothing End Sub Public Sub SaveCollections() Dim cn As ADODB.Connection Call OPEN_CON(cn, "dbsales", "Winpos") Call save_Collections(cn, CustomerID.text, 0, txtAmount.text, 0, 0) End If Set cn = Nothing MsgBox "Done !!!", vbconfirm, "confirm" End Sub
Join the community of 500,000 technology professionals and ask your questions.