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

Table is being deleted, WHY????

Status
Not open for further replies.

enak

Programmer
Jul 2, 2002
412
US
I have inherited an Access db and do not know much about Access, although, I am learning.

There is a query that retrieves data from another query joined with a couple of other tables and then inserts the results into a temp table. This table seems to be missing. I looked at an older version ofthe database and found the table there.

I created the missing table and then ran the query. It deleted the table, displayed a message that the record had been deleted, and then stopped.

Here is the query:

SELECT qryCalFilter.Date AS EventDate, IIf(Not IsNull([time]),Format([time],'h:nn ampm'),' ')
AS EventTime, [eventtype] & IIf([eventtype]= 'deposition', ' (Deponent: ' & [deponent] & ')', '')
AS Event, Trim([casename]) & IIf(Not IsNull([additcases]),
'(Also: ' & Trim([additcases]) & ')', '') & ' - Matter: ' & [FileNumber] &
' (Opp: ' & [plaintiffscounsel] & ') ' & County & '/' & Court AS Cases,
Trim([city]) & ' - ' & [location] AS Loc, qryCalFilter.EventStatus,
qryCalFilter.Responsible, IIf([isamocolead]=-1,' * LEAD * ',' ') AS Lead,
qryCalFilter.Comments, qryCalFilter.EventID
INTO tblTEMPEventList
FROM qryCalFilter, tblPrintDates
WHERE tblCalendar.Date Between #1/1/2004# and #2/28/2005#


What is the problem???

Thanks,
enak
 
INTO tblTEMPEventList
This is a MakeTable query, so tblTEMPEventList is recreated each time this query is executed.

Don't you have an InputBox asking for tblCalendar.Date ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No, I pass a date range into the query. Look at the bottom of the query above.

Also, this was working before. I have compared it to an older version but can not find any discrepancies.
 
I asked just because tblCalendar is not in the FROM clause ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
You are right. tblCalendar is in the query that is called in this query. However, the dates are fed to the query from a form.

Any ideas??
 
this query doesn't delete the table. There has to be some process in the OnForm close event or a button is being pressed, that is calling code to delete the table. Check the form events and see what is happening there.


Leslie
 
I created the table manually. I ran the query outside of the form and the table was deleted. Like I said, I am not an Access expert but I can only report what I see.
 
The query you have is a Make Table query as PHV says above. It will delete the existing table first.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I understand that from the first post where that was stated.

Again, my problem is that after the table is deleted then I get a message "Record is deleted." I can not figure out why the make table query is not working.

 
Does qryCalFilter returns data ?
Does this query without the INTO clause returns data ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top