Delete Record

Evagrius

Registered User.
Local time
Today, 07:47
Joined
Jul 10, 2010
Messages
170
Hi,

When I run this code, it works fine, but I get a value of "#Deleted" in the controls. What am I doing wrong? Thanks!

Code:
If MsgBox("Are you sure you would like to delete History" & _
" from this record only", vbQuestion + vbYesNo,= vbYes Then
    Dim cmd As ADODB.Command
    Set cmd = New ADODB.Command
    cmd.ActiveConnection = CurrentProject.Connection
    cmd.CommandText = "DELETE FROM tblPre WHERE Number = '" & Me.[Ratio Number] & "'"
    cmd.Execute
    Me.Refresh
Else
End If
 
Thank You vbaInet!
 
You're welcome!

By the way you don't need the ELSE line.
 

Users who are viewing this thread

Back
Top Bottom