Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid procedure call issue in Access to Excel Query

Status
Not open for further replies.

maxxev

Technical User
Jul 17, 2008
139
NL
Hi, i'm trying to repeat something i've done before and got working with no problem, this time however I can't get it to work.

I have a query I just want to pass from Access to Excel, it works fine in Microsoft query, but when I try to enter the query data into Excel I get the "invalid procedure call".

Any thoughts as to why?

Thank you

Code:
SELECT Q_SKU_SLIFE_4_PLNG.Active, Q_SKU_SLIFE_4_PLNG.CUSTOMER, Q_SKU_SLIFE_4_PLNG.`Product Code`, Q_SKU_SLIFE_4_PLNG.`Storage Condition`, Q_SKU_SLIFE_4_PLNG.`Dating Notes`, Q_SKU_SLIFE_4_PLNG.Description, Q_SKU_SLIFE_4_PLNG.Shelflife, Q_SKU_SLIFE_4_PLNG.MinlifeintoDepot, Q_SKU_SLIFE_4_PLNG.MinOutloadLife, Q_SKU_SLIFE_4_PLNG.PAV, Q_SKU_SLIFE_4_PLNG.Unit, Q_SKU_SLIFE_4_PLNG.NUTS, Q_SKU_SLIFE_4_PLNG.SESAME, Q_SKU_SLIFE_4_PLNG.GLUTEN, Q_SKU_SLIFE_4_PLNG.`NON-VEGGIE`, Q_SKU_SLIFE_4_PLNG.`DFST Ambient Life`, Q_SKU_SLIFE_4_PLNG.`DFST Chilled Life`, Q_SKU_SLIFE_4_PLNG.InnerBarcode, Q_SKU_SLIFE_4_PLNG.OuterBarcode, Q_SKU_SLIFE_4_PLNG.OuterCaseCode
FROM `G:\Company\DataSheets\ALLERGEN DB.mdb`.Q_SKU_SLIFE_4_PLNG Q_SKU_SLIFE_4_PLNG
 
If you don't know where the SQL is, do View > SQL...

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi, sorry it seems I was connecting via OLEDB in 2007.... but the query doesn't work either..code below

Code:
SELECT TEST.Active, 
[COLOR=#EF2929]TEST.CUSTOMER,[/color] 
TEST.`Product Code`, TEST.Description, 
TEST.`Storage Condition`, TEST.`Dating Notes`, 
TEST.Shelflife, 
TEST.MinlifeintoDepot, TEST.MinOutloadLife, 
TEST.PAV, TEST.Unit, 
TEST.`DFST Ambient Life`, TEST.`DFST Chilled Life`, 
TEST.InnerBarcode, TEST.OuterBarcode, TEST.OuterCaseCode, 
TEST.NUTS, TEST.SESAME, TEST.GLUTEN, TEST.`NON-VEGGIE`
FROM `G:\Company\DataSheets\ALLERGEN DB.mdb`.TEST TEST
 
Is TEST a table or a query in MS Access?

In MS Access, does the Customer field contain valid data?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sorry I forgot to say that I re-named the Query to Test

In Access it does contain valid data, also in the Microsoft query screen it contains valid data, it just doesn't pull through to excel while the below code in access is functioning.
Code:
CUSTOMER: Mid([Full_Product_Code]
,InStr([Full_Product_Code],'.')+1,InStr(4,[Full_Product_Code],'.')-InStr([Full_Product_Code],'.')-1)

If I remove this field excel works fine.
 
I re-named the [highlight]Query[/highlight] to Test
[highlight]THAT[/highlight] is the problem. [highlight]Customer[/highlight] is an alias!

Query your two Left Join [highlight]TABLES[/highlight] directly in Excel MS Query!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top