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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a Delete Query dumps me out of Access

Status
Not open for further replies.

Newuser26

Technical User
May 17, 2006
14
GB
I'm am running a couple of querys, to append data to 2 different tables (depend on result of query) if OK.value = -1 then that data goes to OKrecords table if Error.value = -1 then that data goes to Errorrecords table. That works fine the problem comes when I try and delete the data from then Checkrecord table. Once I have run the above queries I then run the Delete query, so I am not searching on data already checked, Access will run the query and then dump me out of the program ?? I have checked and I don't ask Access to Quit when I finsh running the queries Please Help
 
Which version of Access? Without seeing the code, I'm not sure. Do the queries do the same thing if you run either one from the database window instead of thru code?
 
Hi Sorry, more info I am using Access 2000, The code was:

Private Sub On_Timer()

DoCmd.OpenQuery "DeleteOK", , acEdit
DoCmd.OpenQuery "DeleteError", , acEdit

End Sub

the timer is set for 1 sec. the delete queries are very simple, For the DeleteOK I have a check box called OK and if value = -1 then it will delete it from the checkrecords table. Again with the DeleteError I have a check box called Error and if the value = -1 then it will delete from checkrecords table.
No, as far as I can remember if I run the query in the DB window they will work fine. As I have come across this problem I have had to stop and carry on with the rest of the program. I hope to get back to it ASAP. hopefully with your help ! :)
 
the timer is set for 1 sec
Are you saying the 2 delete queries are launched every second ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Yes, well sort of I have another form with the current date / time on it and between 17:00 and 06:00 the timer interval for the queries is set to 0 and then all other times set to 1 sec. Is this to quick ?? I can slow this down but not by much more as once the info has been checked I need it to be sorted into the two differnet tables.
Apart from the timer is there any other way I can get Access to check if new records have been added to the table ???
 
You may consider playing with a RDBMS not lacking TRIGGERS

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
?????? It might be I am being a bit thick...... what is RDBMS and how do I go about using it ???

Sorry for the dumness
:)
 
Newuser26 . . .

Have a look at the following:

Fundamentals of Relational Database Design

Normalizing Tables

Table Relationships

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top