Hi,
I have the following code
' create the table USAGE
DoCmd.RunSQL ("CREATE TABLE USAGE (MyDate date, MyUsers INTEGER)"
' Put data into new table USAGE.
Dim MyRst As Recordset
Set MyRst = CurrentDb.OpenRecordset("USAGE", dbOpenTable)
With MyRst
While arrayusage(m, 1) <> ""
MyRst.AddNew
Let !MyDate = arrayusage(m, 1)
Let !MYUSERS = arrayusage(m, 2)
MyRst.Update
MyRst.MoveLast
m = m + 1
Wend
End With
The problem comes when it is trying to execute
Set MyRst = CurrentDb.OpenRecordset("USAGE", dbOpenTable)
Access does not find the table, I check it and I see that it is there.
If I add a dialog just before this line and wait for 3-4 seconds, then it will find it.
I supposed Access does not refresh the tables collection before running the next line of code, and therefore it is using the old collection?
Any ideas on how to solve it?
Thanks,
Klasse
I have the following code
' create the table USAGE
DoCmd.RunSQL ("CREATE TABLE USAGE (MyDate date, MyUsers INTEGER)"
' Put data into new table USAGE.
Dim MyRst As Recordset
Set MyRst = CurrentDb.OpenRecordset("USAGE", dbOpenTable)
With MyRst
While arrayusage(m, 1) <> ""
MyRst.AddNew
Let !MyDate = arrayusage(m, 1)
Let !MYUSERS = arrayusage(m, 2)
MyRst.Update
MyRst.MoveLast
m = m + 1
Wend
End With
The problem comes when it is trying to execute
Set MyRst = CurrentDb.OpenRecordset("USAGE", dbOpenTable)
Access does not find the table, I check it and I see that it is there.
If I add a dialog just before this line and wait for 3-4 seconds, then it will find it.
I supposed Access does not refresh the tables collection before running the next line of code, and therefore it is using the old collection?
Any ideas on how to solve it?
Thanks,
Klasse