Solved

syntax error in FROM clause

Posted on 2016-09-25
5
66 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 37

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 22

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 37

Accepted Solution

by:
PatHartman earned 500 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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

724 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