Getting a 3001 error: invalid argument

C

Cameron

Have a process that is cleaning a table that gets populated and then later
deleted to recieve the next population. But for some strange reason I am
getting this error. is there a way to code in exclusive access to this table
so that I do not get this error?

Call SysCmd(acSysCmdSetStatus, "Cleaning Radar participation data")
' step 9, Add RDR data tbl 13
sqlStr = "Delete Radar.* FROM Radar WHERE (format(Radar.RadarDate,
'YYYY')) < " & responce
db.Execute sqlStr
frm.Controls("progressbar").Width = (9 / 13) * 4320
frm.Controls("progressValue") = 9 / 13
frm.Repaint
DoEvents
 
K

Klatuu

You don't say on which line the error occurs.
You dont' show where db is set to anything.

Also, assuming that in you code, before this line:
db.Execute sqlStr

You have
Dim db As DAO.Database

Set db = Currentdb

Also, when you use the Execute method, it is important to use the
dbFailOnError option. The Execute method does not go through the Access User
Interface, so if the SQL command fails, you will not know it unless you use
the option.

db.Execute sqlStr, dbFailOnError

But, post back with which line is the problem and we will have a closer look.
 
C

Cameron

Yes, I am getting the error on db.Execute sqlStr
And the database conections are extablished prior to the code I am having
issues with. Sorry.
 
J

John W. Vinson

Have a process that is cleaning a table that gets populated and then later
deleted to recieve the next population. But for some strange reason I am
getting this error. is there a way to code in exclusive access to this table
so that I do not get this error?

Call SysCmd(acSysCmdSetStatus, "Cleaning Radar participation data")
' step 9, Add RDR data tbl 13
sqlStr = "Delete Radar.* FROM Radar WHERE (format(Radar.RadarDate,
'YYYY')) < " & responce
db.Execute sqlStr
frm.Controls("progressbar").Width = (9 / 13) * 4320
frm.Controls("progressValue") = 9 / 13
frm.Repaint
DoEvents

What is the datatype and value of the misspelled variable 'responce'? Is the
Radar table in fact updateable?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top