Hi,
I have one Form in which i have one subform also which links together by one common_id(Payment_id). When i display record, I need to delete Current record in both form & Table. I used the following code to delete.
---
Dim response
Dim strsql As String
response = MsgBox("Are you sure to Delete?", vbYesNo, "Payment Alteratiion")
If response = vbYes Then
strSQL = "DELETE FROM Payment_Table where Payment_id = " & Payment_id & ";"
CurrentDb.Execute strSQL
strSQL = "DELETE FROM Payment_Detail_Table where Payment_id= " & Payment_id &
";"
CurrentDb.Execute strSQL
Else
Remarks.SetFocus
End If
-----
Its deleting in the main Form data. But, not deleting
in subform data. As well as, it shows the below error which stand 2nd Sql Stmnt of "CurrentDb.Execute strSQL"
--
Run-time error '3075'
syntax error (missing operator) in query expression 'Payment_id='
----
Payment_id is a Control Name.
Believe its clear
Is there any wrong in the code, please suggest me to
proceed further?
Your suggestion & solution would be appreicated GREATLY.
Thanks in advance.
ngr.