Update will be something like -
RS.AddNew
RS!MyFieldNameHere = Text1.Text
'and so on....
RS.Update
Delete something like this -
RS.Delete 'Use bookmark etc for a specific record etc...
Search -
RS.Open "SELECT * FROM YourTable WHERE TheFieldName LIKE '" & Text1.Text & "'", cn, adOpenStatic, adLockOptimistic
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Your execute statement looks fine so, yes, it should update both. If not, let me know as well as where the error occured or if the fields in payment table is empty.
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Mmmm, I normally don't use join statements. I like to do the longer route, but I never get errors.
This is what I would've done -
Dim RS As ADODB.Recordset
Dim rsPayment As ADODB.Recordset
Set RS = New ADODB.Recordset
Set rsPayment = New ADODB.Recordset
RS.Open "SELECT * FROM weddingrecords WHERE TransactionNumber = " & "'" & tn.Text & "'", cn, adOpenStatic, adLockOptimistic
rsPayment.Open "SELECT * FROM payment WHERE NameofBride = "'" & txtBrideName.Text & "'", cn, adOpenStatic, adLockOptimistic
If RS.EOF Then
MsgBox "Transaction Not Found", vbExclamation
Else
rs.AddNew
RS!TransactionNumber = txtTransactionNumber
RS.Update
rsPayment.AddNew
rsPayment!Amount = txtAmount.Text
rsPayment.Update
End If
Will this help?:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350
Fantastic! Happy Coding!:)
AndreRet
Senior Poster
3,922 posts since Jan 2008
Reputation Points: 334
Solved Threads: 350