Welcome to the forum
If I'm reading the code correctly, its saying:
If the table exists , delete it
AFAIK it doesn't tell you to create it
Code:
Public Sub actualizarDisponible()
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb
Set qdf = dbs.QueryDefs("Disponible")
'borrar tabla disponible actual (solo si existe)
'delete table if it exists
If ifTableExists("DisponibleTABLE") Then
dbs.TableDefs.Delete "DisponibleTABLE"
End If
'Set the value of the QueryDef's parameter
qdf.Parameters("fecha_calc").Value = Format(Now(), "yyyy-mm-dd")
'Execute the query
'what is the query?
qdf.Execute dbFailOnError
'Clean up
qdf.Close
Set qdf = Nothing
Set dbs = Nothing
End Sub
Public Function ifTableExists(tblName As String) As Boolean
'función comprueba si una tabla access existe
'suggest you change as shown below in case you have more than one object with the same name
'not a good idea but possible
'If DCount("[Name]", "MSysObjects", "[Name] = '" & tblName & "'") = 1 Then
If DCount("[Name]", "MSysObjects", "[Name] = '" & tblName & "'") > 0 Then
ifTableExists = True
End If
End Function
Please explain why you are deleting the table & where the make table query is.
NOTE: If you use a make table query, it will overwrite any existing table of that name