[AccessD] Too few parameters expected 1

Kaup, Chester Chester_Kaup at kindermorgan.com
Wed May 27 14:48:04 CDT 2009


Yes that was the solution. Thanks.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters
Sent: Tuesday, May 26, 2009 10:49 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Too few parameters expected 1

In your select string, perhaps API14 should be syntaxed something like:

dbo_DSS_CompletionMaster.PID = '" & API14 & "')

Dan

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kaup, Chester
Sent: Tuesday, May 26, 2009 10:41 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] Too few parameters expected 1

Here is the code the generates the error. The SQL statement does not seem to
be reading the variable API14. It is dimmed as text.

Set RS1 = MyDb.OpenRecordset("dbo_DSS_StatusChanges")
Set RS2 = MyDb.OpenRecordset("dbo_DSS_CompletionMaster")
RS2.MoveFirst
API14 = RS2.Fields(0)

strSql = "SELECT dbo_DSS_StatusChanges.PID,
dbo_DSS_CompletionMaster.Well_Number, 
DateSerial(Year(Date()),Month(Date())-1,1) AS RecordDate,
Max(dbo_DSS_StatusChanges.StatusDate) AS MaxOfStatusDate 
FROM dbo_DSS_StatusChanges INNER JOIN dbo_DSS_CompletionMaster ON
dbo_DSS_StatusChanges.PID = dbo_DSS_CompletionMaster.PID 
WHERE (((dbo_DSS_StatusChanges.StatusDate) <= DateSerial(Year(Date()),
Month(Date()) - 1, 1))and dbo_DSS_CompletionMaster.PID = API14)
GROUP BY dbo_DSS_StatusChanges.PID, dbo_DSS_CompletionMaster.Well_Number 
ORDER BY dbo_DSS_CompletionMaster.Well_Number;"


Set RS3 = MyDb.OpenRecordset(strSql)


Chester Kaup
Engineering Technician
Kinder Morgan CO2 Company, LLP
Office (432) 688-3797
FAX (432) 688-3799

 
No trees were killed in the sending of this message. However a large number
of electrons were terribly inconvenienced.


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list