JKDeveloper0718
Programmer
I have a form that Im processing batches of transactions and I have a button that posts the transaction. With that there is a subroutine that updates a table as follows:
Private Sub PostSecurityDeposit(Bnum As Integer)
Dim rsSD As Recordset
Set rsSD = CurrentDb.OpenRecordset("SELECT * FROM tblRCSecurityDepositData WHERE BatchNumber = " & Bnum)
While Not rsSD.EOF
If rsSD!TransCodeId = 5 Then
CurrentDb.Execute ("Update tblHousehold Set UASecurityDeposit = rsSD!NewSecDep where HouseholdId = " & rsSD!HouseholdId)
End If
rsSD.MoveNext
Wend
rsSD.Close
Set rsSD = Nothing
End Sub
So the CurrentDb.Execute ("Update tblHousehold Set UASecurityDeposit = rsSD!NewSecDep where HouseholdId = " & rsSD!HouseholdId) line is the update and it doesnt like this string is there something Im missing within this string that causing a problem. I print out the fields from the loop and they are fine.
Private Sub PostSecurityDeposit(Bnum As Integer)
Dim rsSD As Recordset
Set rsSD = CurrentDb.OpenRecordset("SELECT * FROM tblRCSecurityDepositData WHERE BatchNumber = " & Bnum)
While Not rsSD.EOF
If rsSD!TransCodeId = 5 Then
CurrentDb.Execute ("Update tblHousehold Set UASecurityDeposit = rsSD!NewSecDep where HouseholdId = " & rsSD!HouseholdId)
End If
rsSD.MoveNext
Wend
rsSD.Close
Set rsSD = Nothing
End Sub
So the CurrentDb.Execute ("Update tblHousehold Set UASecurityDeposit = rsSD!NewSecDep where HouseholdId = " & rsSD!HouseholdId) line is the update and it doesnt like this string is there something Im missing within this string that causing a problem. I print out the fields from the loop and they are fine.