Solved

sql ...

Posted on 1998-08-05
5
173 Views
Last Modified: 2010-05-03
Dim db As Database
Dim szsql As String
Dim objXL As Object
Dim numcopies As Integer

Set db = OpenDatabase("c:\stock.mdb")
       
           
szsql = "select into nice_rpt " _
        & "in 'c:\excel\nice_rpt.xls' 'EXCEL 5.0;' Description.StockCardNo as 'stockcode', Description as 'Description', Product.Specifications as 'Specifications', Product.ProductID as 'ProductID' from Description, Product where " _
        + "Description.StockCardNo = Product.StockCardNo"

MsgBox szsql
db.Execute szsql
numcopies = 1

Set objXL = CreateObject("excel.application")
objXL.workbooks.Open "c:\excel\path\nice_rpt.xls"
objXL.activeworkbook.activesheet.printout , , numcopies 'variable you define
objXL.activeworkbook.Close
Set objXL = Nothing

i got an error in the sql.. what's wrong?
0
Comment
Question by:brohans
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:MorFF
ID: 1468069
You've got a + instead of an &   

"      + "Description.StockCardNo = Product.StockCardNo"      "

MorFF
0
 

Author Comment

by:brohans
ID: 1468070
it did not work :(
0
 

Author Comment

by:brohans
ID: 1468071
Adjusted points to 100
0
 

Accepted Solution

by:
stefie earned 100 total points
ID: 1468072
Maybe you can change Description as 'Description' in :
Description.Description as 'Description'
0
 
LVL 3

Expert Comment

by:MorFF
ID: 1468073
What does the error say?
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question