automatically run a delete query

sullivan

Registered User.
Local time
Today, 21:28
Joined
Apr 24, 2001
Messages
48
Within a split database I have a table that I probably don't need, but I'm not sure.

Right now, the table holds data that is entered to create faxes. Part of the data for the report is pulled from another table in combo boxes (fax number & company name) the rest is entered by the user, and all the data for each record is stored in one table. There is no need to save the data in a table, and my first thought is to find a way to run a delete query every day. Is there a way to do this?

Or is there a way to transfer data directly from a form to a report without storing any data in a table - I thought this would take up too much memory though. Does anyone have any suggestions?

Thanks, Jennie
 
Jennie,

I don't think that you should worry about "collecting" too
many records in your table. You would need far more than
you think to cause you any trouble. To maintain it, you
can put (maybe you have already) a date field that contains
todays date. Before running your main form, or from a
command button, you can delete all records that are older
than 30 days or so.

I think that it would be more work (for you) to NOT use a
table. You would have to use an unbound form, the form
would have to be open, more prone to mistakes, etc.
Using a table, you can have the form wizard make a form.
Then you clean it up and on the command button for your
report:

Code:
If IsNull(Me.Combo1) Or IsNull(Me.Combo2) Then
   MsgBox("You must select from the combos")
   Exit Sub
End If

DoCmd.OpenReport "YourReport",,,"FAXID = " Me.FAXID

Wayne
 
Thanks for the reply. I already have the form and report created, this db has been in use for a few years now. The users have requested to delete the stored data - they find it unnerving to have it stored, and they won't listen to reason.

I guess my question is: what would be the best way to delete the data? Is the delete query the best step, if so, how do I connect it to the form to run automatically? Or should I use a macro? What do you suggest? I'm quite the novice programer, so when I'm faced with new problems that don't have solutions in my books, I'm not very good at improvising.

Thanks for the help.
 

Users who are viewing this thread

Back
Top Bottom