This is my syntax and I am attempting to
1) Delete query if already exists
2) Create new query
My syntax presents no errors, but the query is not created.
Code:
Private Sub Ctl_Click()
Dim strsql As String, qdf As QueryDef
'Deleting query if exists
On Error Resume Next
CurrentDb.QueryDefs.Delete ("EB")
strsql = "Select firstbase, secondbase, thirdbase, so, h, w from baseballstats"
Set qdf = CurrentDb.CreateQueryDef("EB", strsql)
'Open the Report
DoCmd.OpenForm "EB", acNormal
End Sub
What do I need to change so that tthe query is created?