P
Pete Straman Straman via AccessMonster.com
ometimes I have to run my program over because I have no error catching
code. For the code below my program stops running because the queries have
already been created. I need an if statement to either skip over making the
query if it has already been made or to delete and recreate it. what should
be in the if statement to accomplish this task.
thanks in advance.
My code is listed below.
Pete S.
Private Sub cmdRecordCount_Click()
Dim db060004 As Database
Dim qdfNew As QueryDef
Set dbs060004 = OpenDatabase("060004 Tara.mdb")
With dbs060004
' Create 060004 Original Record Count Query
Set qdfNew = .CreateQueryDef("060004_Original", "SELECT Count([060004
Original].facilityid)" _
+ " AS [060004 Original]FROM [060004 Original];")
.Close
End With
MsgBox "Record Count and 'trend_rpt' queries have been created."
End Sub
code. For the code below my program stops running because the queries have
already been created. I need an if statement to either skip over making the
query if it has already been made or to delete and recreate it. what should
be in the if statement to accomplish this task.
thanks in advance.
My code is listed below.
Pete S.
Private Sub cmdRecordCount_Click()
Dim db060004 As Database
Dim qdfNew As QueryDef
Set dbs060004 = OpenDatabase("060004 Tara.mdb")
With dbs060004
' Create 060004 Original Record Count Query
Set qdfNew = .CreateQueryDef("060004_Original", "SELECT Count([060004
Original].facilityid)" _
+ " AS [060004 Original]FROM [060004 Original];")
.Close
End With
MsgBox "Record Count and 'trend_rpt' queries have been created."
End Sub