Jumat, 18 Mei 2012

RE: [MS_AccessPros] SQL parm needed...?

 

Liz-

That usually means you misspelled a field name. Add a Debug.Print strSQL and a Stop right after that. Copy what you see in the Immediate Window into the SQL View of a new query and then try to switch to Design view.

Why are you using Execute on a SELECT query?

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

------------------

From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Liz Ravenwood
Sent: Friday, May 18, 2012 5:47 PM
To: 'MS_Access_Professionals@yahoogroups.com'
Subject: [MS_AccessPros] SQL parm needed...?

Okay SQL experts:

I'm getting an error message that a parameter is expected, but don't know where it is wanting it.

Here's the code:

strsql = "SELECT bePCPlanIndBOM.[$$RRLV] AS [Level], bePCPlanIndBOM.[$$ITEM] AS Component, " & _
"bePCPlanIndBOM.[$$DESC] AS Description, bePCPlanIndBOM.[$$UOM] AS UM, bePCPlanIndBOM.[$$STKT] AS Type, " & _
"bePCPlanIndBOM.[$$QTY1] AS [Required Per], " & _
Forms![CSQuotes]![Qty] & " AS Requested, [Required Per]*[Requested] AS Extended, " & _
"ItemQtyOH.JDEQty AS [On hand], [On hand]-[Extended] AS Available" & _
" FROM (GetProgSSForParent INNER JOIN bePCPlanIndBOM ON (GetProgSSForParent.TimeStamp = bePCPlanIndBOM.TimeStamp)" & _
" AND (GetProgSSForParent.ProgSS = bePCPlanIndBOM.ProgSS))" & _
" INNER JOIN ItemQtyOH ON bePCPlanIndBOM.[$$ITEM] = ItemQtyOH.ItemNum;"
Currentdb.execute(strsql)

I've accounted for the form field it is pulling in, but am wondering if the calculated fields are tripping me up.

Liz Ravenwood
Database Developer / Programmer
Super First Class Products
B/E Aerospace
O: 1.520.239.4808
www.beaerospace.com

This email (and all attachments) is for the sole use of the intended recipient(s) and may contain privileged and/or proprietary information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar