E
EagleOne
2007
BTW, I did post this in "macros" which was probably not the best the group.
My file is Test.mdb which has 3 tables:
TransactionsTbl (This table has a field called AccountNumber)
TrialBOYTbl (This table has a field called AccountNumber)
TrialEOYTbl (This table has a field called AccountNumber)
I wish to add another Table (in Test.mdb) called AccountNumbers
My attempts have failed to write a successful SELECT UNION query which
I want only unique account numbers be added.
For sure, the answer is in my face but I cannot see it.
My Query is: (The error is runtime "error 3065 cannot execute a select query)
Currentdb.Execute "SELECT [AccountNumber] INTO AccountNumbers FROM TrialBOYTbl" & _
" UNION SELECT [AccountNumber] FROM TrialEOYTbl" & _
" UNION SELECT [AccountNumber] FROM TransactionsTbl" & _
" ORDER BY [AccountNumber];"
Any help appreciated.
TIA EagleOne
BTW, I did post this in "macros" which was probably not the best the group.
My file is Test.mdb which has 3 tables:
TransactionsTbl (This table has a field called AccountNumber)
TrialBOYTbl (This table has a field called AccountNumber)
TrialEOYTbl (This table has a field called AccountNumber)
I wish to add another Table (in Test.mdb) called AccountNumbers
My attempts have failed to write a successful SELECT UNION query which
I want only unique account numbers be added.
For sure, the answer is in my face but I cannot see it.
My Query is: (The error is runtime "error 3065 cannot execute a select query)
Currentdb.Execute "SELECT [AccountNumber] INTO AccountNumbers FROM TrialBOYTbl" & _
" UNION SELECT [AccountNumber] FROM TrialEOYTbl" & _
" UNION SELECT [AccountNumber] FROM TransactionsTbl" & _
" ORDER BY [AccountNumber];"
Any help appreciated.
TIA EagleOne