Solved

sql ...

Posted on 1998-08-05
5
175 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

624 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