Why doesn't this work every time when the same thing DOES work for queries?
Code:If TableExists(gLookUpsDB, "tmpJobNames") Then gLookUpsDB.TableDefs.Delete "tmpJobNames" gLookUpsDB.TableDefs.Refresh Private Function TableExists(ByVal DB As Database, ByVal TableName As String) As Boolean Dim bFound As Boolean Dim td As TableDef For Each td In DB.TableDefs If td.Name = TableName Then bFound = True Exit For End If Next TableExists = bFound End FunctionI'm befuddled and unamused! >:[Code:'Check to see if queries exist With gLookUpsDB.QueryDefs If QueryExists(gLookUpsDB, "PerItemSubReportQuery") Then .Delete "PerItemSubReportQuery" If QueryExists(gLookUpsDB, "MiscChargesReportQuery") Then .Delete "MiscChargesReportQuery" If QueryExists(gLookUpsDB, "PerItemandMiscChargesReportQuery") Then .Delete "PerItemandMiscChargesReportQuery" .Refresh End With Private Function QueryExists(ByVal DB As Database, ByVal QueryName As String) As Boolean Dim bFound As Boolean Dim qd As QueryDef For Each qd In DB.QueryDefs If qd.Name = QueryName Then bFound = True Exit For End If Next QueryExists = bFound End Function
Laurel
P.S. Did you miss me?


Reply With Quote



Bookmarks