Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

How to Delete a record in a subform when you click a button in Access

$
0
0
Hey there good day people can anyone help me with this one im getting a run time error '3131' Syntax error in FROM clause can anyone tell me what i done wrong. Thanks in advance Code below:

Private Sub cmdDelete_Click()
Dim strSQL
If Not (Me.PlantTransactionQuery.Form.Recordset.EOF And Me.PlantTransactionQuery.Form.Recordset.BOF) Then
If MsgBox("Are you sure you want to delete", vbYesNo) = vbYes Then
strSQL = "Delete * FROM PlantTransactionQuery" & _
"WHERE TransactionID=" & Me![TransactionID] & Me.PlantTransactionQuery.Form.Recordset.Fields("Tr ansactionID")
CurrentDb.Execute strSQL
Me.PlantTransactionQuery.Form.Requery
End If
End If
End Sub

Your help will be appreciated :)

Viewing all articles
Browse latest Browse all 13329

Trending Articles