?
Solved

syntax error in FROM clause

Posted on 2016-09-25
5
Medium Priority
?
74 Views
Last Modified: 2016-09-26
Hi i am using adodc4 control to print but getting error "Syntax error in FROM clause"
"BillSumry" is not table but its a query in access,

Please assist

    With Adodc4                    
         .RecordSource = "SELECT Invo_No,Date_Invo,Net_Amt,Pkg_Chg,Pkg_Amt,Comison,Tax_Amt,Loading,DiscOn FROM BillSumry"
        .Refresh
        
    End With
    
    With DataReport10
        
        Set .DataSource = Adodc4
        
        .Sections("Section2").Controls("Label3").Caption = Text2.Text
        .Show
    
    End With

Open in new window

0
Comment
Question by:crystal_Tech
[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 38

Expert Comment

by:PatHartman
ID: 41814760
Open the Access query editor in SQL view.  Paste in the SQL string and run the query.  Do you get any errors?  Does it prompt for a variable?

Does BillSummary take any arguments?
0
 
LVL 1

Author Comment

by:crystal_Tech
ID: 41815049
Thanks for reply
No, Not getting any error, And no any prompt for variable..?
getting all data,
and this is the query,  BillSummary is not table but query in DB (Ms Access)
SELECT DISTINCT BillDtl.BillNo AS Invo_No, CFT_NEW.Date_Invo, BillDtl.NetAmt AS Net_Amt, BillDtl.PkgChg AS Pkg_Chg, BillDtl.PkgAmt AS Pkg_Amt, BillDtl.Commission AS Comison, BillDtl.TaxAmt AS Tax_Amt, BillDtl.Loading, BillDtl.DiscOn, BillDtl.DiscAmt, BillDtl.GrandTTL, BillDtl.BndlTTL, CFT_NEW.CustName
FROM BillDtl, CFT_NEW
WHERE BillDtl.BillNo=CFT_NEW.InvoNo;

Open in new window

and this is from VB code..as i mention in my question
"SELECT Invo_No,Date_Invo,Net_Amt,Pkg_Chg,Pkg_Amt,Comison,Tax_Amt,Loading,DiscOn FROM BillSumry"

Open in new window

0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 41815150
What happens if you use Select *?
Also are you sure about the name of the query BillSumry?
0
 
LVL 38

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 41815305
FROM BillDtl, CFT_NEW
is old fashioned syntax and in an Access query results in a Cartesian Product which among other issues is always not updateable.

Make the join specific by changing the where clause to a join.

FROM BillDtl Inner Join CFT_NEW ON BillDtl.BillNo = CFT_NEW.InvoNo;
0
 
LVL 1

Author Closing Comment

by:crystal_Tech
ID: 41816145
it works
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

801 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