Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba
Thread: No value given for one or more required parameters

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

No value given for one or more required parameters
DavidES 21.09.2006 20:07:02
I keep getting an error that says, "No value given for one or more required
parameters" on the rs.Open line in the code below. The SQL for the query is
copied from a query and works great. I cannot figure out the problem.

This is a rewrite of some aircode I found on this discussion group. So the
main problem is I am working with something I don't fully understand. Your
help is greatly appreciated.

Dim rs As New ADODB.Recordset
rs.Open "SELECT UPS_CSV_EXPORT.Track FROM UPS_CSV_EXPORT
WHERE (((UPS_CSV_EXPORT.order) = [Forms]![EmailForm2]![order]) And
((UPS_CSV_EXPORT.Track) <= '9') And ((UPS_CSV_EXPORT.PUDate) > #9/17/2006#))
ORDER BY UPS_CSV_EXPORT.Track", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic

strEmail = ""

Do While Not rs.EOF
strEmail = strEmail & rs!Track & " ; "
rs.MoveNext
Loop


RE: No value given for one or more required parameters
Klatuu 21.09.2006 20:34:02
The references to your form controls has to be outside the quotes:

rs.Open "SELECT UPS_CSV_EXPORT.Track FROM UPS_CSV_EXPORT
WHERE (((UPS_CSV_EXPORT.order) = '" & [Forms]![EmailForm2]![order] & "') And
((UPS_CSV_EXPORT.Track) <= '9') And ((UPS_CSV_EXPORT.PUDate) > #9/17/2006#))
ORDER BY UPS_CSV_EXPORT.Track", CurrentProject.Connection, adOpenKeyset,
adLockOptimistic


The above assumes UPS_CSV_EXPORT.order is a text field. It it is a numeric
field then you would not include the single quotes:

(UPS_CSV_EXPORT.order) = " & [Forms]![EmailForm2]![order] & ") And

"DavidES" wrote:

[Quoted Text]
> I keep getting an error that says, "No value given for one or more required
> parameters" on the rs.Open line in the code below. The SQL for the query is
> copied from a query and works great. I cannot figure out the problem.
>
> This is a rewrite of some aircode I found on this discussion group. So the
> main problem is I am working with something I don't fully understand. Your
> help is greatly appreciated.
>
> Dim rs As New ADODB.Recordset
> rs.Open "SELECT UPS_CSV_EXPORT.Track FROM UPS_CSV_EXPORT
> WHERE (((UPS_CSV_EXPORT.order) = [Forms]![EmailForm2]![order]) And
> ((UPS_CSV_EXPORT.Track) <= '9') And ((UPS_CSV_EXPORT.PUDate) > #9/17/2006#))
> ORDER BY UPS_CSV_EXPORT.Track", CurrentProject.Connection, adOpenKeyset,
> adLockOptimistic
>
> strEmail = ""
>
> Do While Not rs.EOF
> strEmail = strEmail & rs!Track & " ; "
> rs.MoveNext
> Loop
>
>
RE: No value given for one or more required parameters
DavidES 21.09.2006 21:27:02
Thanks! Worked like a charm!

"Klatuu" wrote:

[Quoted Text]
> The references to your form controls has to be outside the quotes:
>
> rs.Open "SELECT UPS_CSV_EXPORT.Track FROM UPS_CSV_EXPORT
> WHERE (((UPS_CSV_EXPORT.order) = '" & [Forms]![EmailForm2]![order] & "') And
> ((UPS_CSV_EXPORT.Track) <= '9') And ((UPS_CSV_EXPORT.PUDate) > #9/17/2006#))
> ORDER BY UPS_CSV_EXPORT.Track", CurrentProject.Connection, adOpenKeyset,
> adLockOptimistic
>
>
> The above assumes UPS_CSV_EXPORT.order is a text field. It it is a numeric
> field then you would not include the single quotes:
>
> (UPS_CSV_EXPORT.order) = " & [Forms]![EmailForm2]![order] & ") And
>
> "DavidES" wrote:
>
> > I keep getting an error that says, "No value given for one or more required
> > parameters" on the rs.Open line in the code below. The SQL for the query is
> > copied from a query and works great. I cannot figure out the problem.
> >
> > This is a rewrite of some aircode I found on this discussion group. So the
> > main problem is I am working with something I don't fully understand. Your
> > help is greatly appreciated.
> >
> > Dim rs As New ADODB.Recordset
> > rs.Open "SELECT UPS_CSV_EXPORT.Track FROM UPS_CSV_EXPORT
> > WHERE (((UPS_CSV_EXPORT.order) = [Forms]![EmailForm2]![order]) And
> > ((UPS_CSV_EXPORT.Track) <= '9') And ((UPS_CSV_EXPORT.PUDate) > #9/17/2006#))
> > ORDER BY UPS_CSV_EXPORT.Track", CurrentProject.Connection, adOpenKeyset,
> > adLockOptimistic
> >
> > strEmail = ""
> >
> > Do While Not rs.EOF
> > strEmail = strEmail & rs!Track & " ; "
> > rs.MoveNext
> > Loop
> >
> >

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net