Can't fine my table (1 Viewer)

BigJimSlade

Registered User.
Local time
Today, 03:46
Joined
Oct 11, 2000
Messages
173
Hi, Big Jim here!

I am attemptint to run a query below in code. I kept getting an error that Access could not find the table. So...I ran through the tabledefs to make sure that Access could see it. Access could see the table, but when I attempted to run my SQL after it found the table, it said that it could not find it again. I don't get it. Does this make any sense?


For Each tbl In CurrentDb.TableDefs
If tbl.Name = "Curr_Rnl_Data" Then
DoCmd.RunSQL "DELETE * FROM UniqueCycle;"
DoCmd.RunSQL "INSERT INTO UniqueCycle SELECT DISTINCT Cycle_ID FROM Curr_Rnl_Data;"

End If
Next tbl

When I get the error and go to break mode, if I step into it, it works fine.

Thanks for reading!

Big Jim
 
Last edited:

BigJimSlade

Registered User.
Local time
Today, 03:46
Joined
Oct 11, 2000
Messages
173
In case anyone was interested, I solved this problem by adding some pauses in the code. I guess something in the background was not getting completed before my code moved on to the next line.

Hope this helps someone out!

Big Jim
 

Users who are viewing this thread

Top Bottom