Why don't you construct the proper SQL and use that as the RecordSource for
the Report instead of worrying about a stored procedure? Just bear in mind
that SQL Server's "flavor" of SQL is a bit different than Access' "flavor"
of SQL (e.g., the "*" wildcard used in Access is "%" in MS SQL Server).
Larry Linson
Microsoft Access MVP
> I've got an A2K adp that allows the user to select one or all medical
> residents for a report. I'd like to allow the user to select more than one
> resident as well. Creating a stored procedure to select just one resident
> or selecting all residents is simple. If this were an mdb, I'd construct a
> SQL statement that would take all chosen residents and pull just those from
> a table. Is there a way to do this in a sp?
EManning - 09 Jul 2004 14:07 GMT
Thanks for your reply, Larry. That's what I thought I'd have to do.
However I wanted to make sure there wasn't something I was missing as far as
using a stored procedure for this.
> Why don't you construct the proper SQL and use that as the RecordSource for
> the Report instead of worrying about a stored procedure? Just bear in mind
[quoted text clipped - 13 lines]
> from
> > a table. Is there a way to do this in a sp?
Robertq - 29 Aug 2004 16:26 GMT
Larry
try changing the where clause to have an or for the
selection values, be sure to put the paren's around the or
statement or it will always return all records
@wantres varchar(30) default ""
select * from myfile
where mycode = (@wantcode or @wantcode = "")
instead of
where mycode = @wantcode
>-----Original Message-----
>Why don't you construct the proper SQL and use that as the RecordSource for
[quoted text clipped - 16 lines]
>
>.
"EManning" <emanning_spambegone@kumc.edu> wrote in news:OlsixHSZEHA.3112
@tk2msftngp13.phx.gbl:
> I've got an A2K adp that allows the user to select one or all medical
> residents for a report. I'd like to allow the user to select more than one
> resident as well. Creating a stored procedure to select just one resident
> or selecting all residents is simple. If this were an mdb, I'd construct a
> SQL statement that would take all chosen residents and pull just those from
> a table. Is there a way to do this in a sp?
IN

Signature
Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.
EManning - 09 Jul 2004 14:37 GMT
Well, I thought about that but how would I create the list of residents
chosen for the IN statement?
> "EManning" <emanning_spambegone@kumc.edu> wrote in news:OlsixHSZEHA.3112
> @tk2msftngp13.phx.gbl:
[quoted text clipped - 7 lines]
>
> IN