Solved

sql ...

Posted on 1998-08-05
5
174 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

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 …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

738 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