For backingup purposes i use the following code that's works fine.
However, after running the code, the new table isn't display in the navigation pane. I have to press the functonkey F5 to get it done.
I added the code : SendKeys "{F5}" but that didn't help.
What can i do to see the table in the navigation pane after running the code, without the need to press F5
Dim Naam As string
Dim strSQl As string
Naam = "tblOrders"
strSql1 = "SELECT tblOrderdetails.*,* INTO " & naam1 & " FROM tblOrderdetails WHERE (Right$([OrderID],2)= """ & Right$(Year(Now()), 2) & """" & ")" & ";"
On Error Resume Next
db.QueryDefs.Delete ("qMakeBackups")
On Error GoTo 0
Set qdf = db.CreateQueryDef("qMakeBackups", strSql1)
qdf.Execute
However, after running the code, the new table isn't display in the navigation pane. I have to press the functonkey F5 to get it done.
I added the code : SendKeys "{F5}" but that didn't help.
What can i do to see the table in the navigation pane after running the code, without the need to press F5
Dim Naam As string
Dim strSQl As string
Naam = "tblOrders"
strSql1 = "SELECT tblOrderdetails.*,* INTO " & naam1 & " FROM tblOrderdetails WHERE (Right$([OrderID],2)= """ & Right$(Year(Now()), 2) & """" & ")" & ";"
On Error Resume Next
db.QueryDefs.Delete ("qMakeBackups")
On Error GoTo 0
Set qdf = db.CreateQueryDef("qMakeBackups", strSql1)
qdf.Execute