Running a Delete Query on Prompt

Banana

split with a cherry atop.
Local time
Today, 06:38
Joined
Sep 1, 2005
Messages
6,318
I'm trying to add a button that will allow users to delete all data they previously entered for a particular client. I am getting an error saying that Access couldn't find the expression "|" referred in my code. I suspect it is because I may have the string all wrong.

Here is my code.

Code:
Dim ClientID As Long

ask = MsgBox(["This will delete all I & R info for this client. Do you want to continue?"], [vbYesNo], ["Alert!"]) = vbYes
    If ask = 6 Then
    ClientID = Me.ClientID
    sSql = "DELETE ClientIR.ClientID FROM ClientIR WHERE (((ClientIR.ClientID)=&ClientID&));"
    DoCmd.RunSQL sSql
    DoCmd.Close
Else

TIA for insights.
 
DELETE ClientIR.ClientID FROM ClientIR WHERE (((ClientIR.ClientID)=" & ClientID & "));"
 

Users who are viewing this thread

Back
Top Bottom