Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querydef not deleting all records

Status
Not open for further replies.

ruyeno22

Programmer
Aug 14, 2001
19
PA
Hello:

i am using dao to execute a couple of querys as a transaction.

im using querydef to delete some records from a table that has the following info:

year number
day number
month number

i have the whole 2001 year and the whole 2002.

my query is: "delete * from table where year=[anio]"

when i exexute this query, it does not delete the first day of january of 2002...

whats wrong???

heres the code:Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim qdf2 As DAO.QueryDef
Dim wsp As DAO.Workspace

DoCmd.SetWarnings False

Set wsp = DBEngine.Workspaces(0)
wsp.BeginTrans
Set db = CurrentDb


Set qdf = db.querydefs("c_delete")
qdf.Parameters("ano") = Me.ca_anio
'qdf.Parameters("ano2") = Me.ca_anio
qdf.Execute dbFailOnError

Set qdf = db.querydefs("c_iniferiados")
qdf.Execute dbFailOnError

Set qdf = db.querydefs("c_initnoct")
qdf.Execute dbFailOnError

Set qdf = db.querydefs("c_inidiast")
qdf.Execute dbFailOnError


wsp.CommitTrans

DoCmd.SetWarnings True

MsgBox "El calendario ha sido eliminado", vbInformation

Set qdf = Nothing
Set db = Nothing
Set wsp = Nothing


DoCmd.Close acForm, Me.Name, acSaveNo 'para cerrar la forma


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top