Open Recordset

kbreiss

Registered User.
Local time
Today, 10:44
Joined
Oct 1, 2002
Messages
228
I'm attempting to use this piece of code...
Set rstMerge = CurrentDb.OpenRecordset("qrypopulate", dbOpenDynaset)

My query "qryPopulate" has two parameters
SELECT .....
FROM qryEventInfo
WHERE Location=[Enter Exact Location] AND Event_Date=[Enter Event Date mm/dd/yyyy];

However...after the "set rsmerge" line of code I receive a
"Too few parameters expected" error. How do I get around this. Normally when I run the query it pops up and asks me for "Exact Location" and "Event Date" which I supply and the query runs

Please help
Kacy
________
AMATUER FUCK
 
Last edited:
Kacy,

Whenever Access asks you for parameters, it means it has objects
that it can't resolve.

Obviously when qryPopulate runs it encounters:

WHERE Location=[Enter Exact Location] AND Event_Date=[Enter Event Date mm/dd/yyyy];

[Enter Exact Location] and
[Enter Event Date mm/dd/yyyy]

are things that it hasn't had defined yet and it asks you.

But it is also finding --> [Exact Location] and [Event Date]

It has no definitions for them and consequently prompts you for
their values. These can't be fields in the table that feeds the
query.

Check the table's definition against the query's fields. Sometimes
with embedded spaces; [EventDate], [Event Date], [Event_Date] can be
the same or different things.

hth,
Wayne
 
This has been asked many times; please search the forum before posting your questions.

You need to provide Parameter values using DAO/ADO.
 

Users who are viewing this thread

Back
Top Bottom