Hi, I have written this code for a delete button, when it runs through, there doesnt seem to be a functional error but doesnt delete the row in the table.
How can I get around this issue?
Private Sub btnDeleteInput_Click()
If Me.Pharmacy <> "DO NOT DELETE THIS ROW" Then 'My Key field in table
varResponse = MsgBox("Are You Sure?", vbYesNo, cApplicationName)
If varResponse = vbNo Then
Dim sQRY As String
sQRY = "DELETE tblData.* FROM tblData " & _
"WHERE tblData.FormNumber = " & Me.FormNumber & ";"
Me.RecordSource = "SELECT tblData.* FROM tblData WHERE " & _
"tblData.Pharmacy = ' ';"