Rabu, 28 November 2012

[MS_AccessPros] Append Query Too Few Parameters Error

 

Greetings All,

I am using Access 2007 on Win 7. I am attempting to add records to a temporary table in code with the following append query:

INSERT INTO tmpCheckWriting ( CheckDate, SubsPdServ, SubsNPServ, SubsPdClaim, SubsNPClaim, SubsDollarPayout )
SELECT sd.CheckDate, sd.SubsPdServ, sd.SubsNPServ, sd.SubsPdClaim, sd.SubsNPClaim, sd.SubsDollarPayout
FROM qrySubscriber_Detail AS sd;

When i try to Execute this query from code, I receive a run-time error 3061 "Too few parameters. Expected 2." I built this query using the query design grid and then copied the SQL to my procedure. The query runs fine without an error when run from the query design window.

The query in the FROM statement joins two other queries that select the dates and values for subscriber services and claim that were paid or not paid. Those two queries each have a where clause that selects data based on the beginning end ending date displayed on the form where the user will run the append query. I have the form open and the date fields are filled-in.

Why will the query run from the query design window but not run through vba code?

Darrell

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar