ghudson
Registered User.
- Local time
- Today, 13:50
- Joined
- Jun 8, 2002
- Messages
- 6,194
I have a process that creates a table [make table query] which is done when the records need to be refreshed [this is not a simple requery process]. Then next part of the function is opening up a record set based on that table. I am getting a runtime error # 3078 - The Microsoft Jet database engine cannot find the input table because the make table process has not completed and the record set 'step' is trying to populate the data. How can I loop through this code to continue until the table exists?
Thanks in advance for your help!
Code:
Set dbRisk = OpenDatabase("X:\mydatabase.mdb")
DoCmd.OpenQuery "qryCreateRecords" 'make tblRecords table query
[COLOR=Blue]
Dim db As Database
Dim rs As Recordset
Dim x As Object
For Each t In CurrentDb.TableDefs
If x.Name = "tblRecords" Then
' MsgBox "table exists"
End If
Next x
[/COLOR]
Set rs = db.OpenRecordset("tblRecords")
Thanks in advance for your help!