473,385 Members | 1,311 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

7871 The table name you entered doesn't follow Microsoft Office Access object-naming

Hello all,

I'm working with Access 2007 and my VB code is getting an error at:

Expand|Select|Wrap|Line Numbers
  1.    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, _
  2.          strSourceName, strFileName, False
I'm attempting to insert a query into that method, and I'm getting the error:

7871 The table name you entered doesn't follow Microsoft Office Access object-naming rules
strSourceName in the above code is the following query (Which, if I run on it's own, works! and returns the correct values!!!)

Expand|Select|Wrap|Line Numbers
  1. SELECT tblEquipment.equipmentID, 
  2. tblCompartment.compartmentCode, 
  3. tblSample.sampleNumber, 
  4. tblSampleResult.Cu 
  5. FROM     
  6. ((
  7.         tblEquipment INNER JOIN tblCompartment ON 
  8. tblEquipment.[equipmentID] = tblCompartment.[equipmentID]
  9.  
  10.  
  11.         INNER JOIN tblSample ON
  12.  tblCompartment.[compartmentAutoID] = tblSample.[compartmentSpecific]
  13.  
  14. INNER JOIN tblSampleResult ON 
  15. tblSample.[sampleNumber] = tblSampleResult.[sampleCode] 
  16.  
  17.  
  18.  
  19. WHERE tblCompartment.compartmentCode=1 AND 
  20. tblEquipment.equipmentID=26646;
Nov 14 '09 #1
2 4958
mwasif
802 Expert 512MB
Moved to relevant forum.
Nov 14 '09 #2
I figured out that I was passing in a string when I needed to create a QueryDef,

not I'm getting an error saying "3274 external table is not in the expected format" at the same line.

My SQL looks good to me and I don't see what would be wrong with my table design.
Nov 14 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: deko | last post by:
How to run action query against linked table? I have an Access 2003 mdb with an Excel 2003 Workbook as a linked table. When I attempt to run an action query against the linked table I get this...
28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
41
by: Ruby Tuesday | last post by:
Hi, I was wondering if expert can give me some lite to convert my word table into access database. Note: within each cell of my word table(s), some has multi-line data in it. In addition, there...
8
by: kaosyeti | last post by:
i have a (hopefully) small problem. i have created a system where a user enters customer information into a table through a form. this table has no primary key. there are 9 fields on the form to...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
3
by: hary08 | last post by:
im doing a database for Hospital Admission, I have a log in form which prompt user for a password. The source of log in is to look for the values in my Table tblEmployees and match user name and...
7
JodiPhillips
by: JodiPhillips | last post by:
Hi, My first post! I've basically taught myself Access and the little I know about VBA through reading these forums and a couple of books. I'm in the middle of a project at work - to put it...
3
by: sara | last post by:
Hi - I have a little system in Access 2003 to enter and track Problems - Help Desk type situation. I have a Main table tblTickets and a Child table tblTicketActions tblTickets has a...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
7
by: TG | last post by:
hi! I am trying to create a sql server table from an excel sheet. Here is the code I have: 'This procedure the xlsx file and dumps it to a table in SQL Server
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.