Re: Passing values




Sylvain,

Thanks for your reply.

I don't know how much detail to go into but I really need
some help. The more you know the better chances are I can
get an answer.

In Access the user opened a form where he could select
certain accounts to review. The form allowed the user to
select up to 15 accounts and threshold amounts to view in
a report at one time. The form has 2 combo boxes, one for
the account number and one for the amount to use as a
threshold for that account. The selections have to be
made by account and then amount. As each combo box is
updated, that value is passed to a text box. That is,
when an account is selected then txtAcct1 would populate.
Then he would need to select a threshold amount. That
would then populate txtAmt1. Successive selections would
go to their corresponding text boxes, txtAcct2, txtAmt2,
etc. When the user was done making his selections he
would click the Okay button. This would run an append
query and then open a report showing his selections. In
the query I had language in the criteria column "[Forms]!
[frmAcctSelectCard]![txtAcct1]" under AcctNbr and "[Forms]!
[frmAcctSelectCard]![txtAmt1]" under Amt. These go
through txtAcct15 and txtAmt15. So these values were
passed through to the query from the frmAcctSelect. This
is what I can no longer do and cannot figure out how to
get it to work.

I hope I have given enough information to get a mental
picture of what I did and what I'm now trying to do. If
you can help it would be wonderful.

>-----Original Message-----
>Try with the name of the SP as the Record Source; « dbo »
as the Record
>Source Qualifier (if dbo is the owner of this SP, of
course) and set the
>Input Parameters to the list of parameters that you want
to pass:
>
>@ComboDate datetime = Forms!f_StHb!ComboDate,
@ComboIdOrganisme int =
>Forms!f_StHb!ComboIdOrganisme, ...
>
>Use the comma as the separator list (excerpt if you have
set the Windows'
>separator list on your system to something else) and use
Shift-F2 for an
>easier editing and make liberal use of the Refresh (F5)
function of the View
>menu for the Queries Window.
>
>(Also, in the past, with the first versions of ADP, I was
under the
>impression that it was much better to write the
parameters list by
>alphabetical order of type (for example, datetime values
before integer
>values and integer values before smallint values); both
for the SP and the
>InputParameters. I don't know if it's really usefull to
do this.)
>
>Functions doesn't return a recordset, so you can't use
them directly.
>Usually, I set the Record Source to something like «
Select * from Fct (v1,
>v2, ...) » when I want to use a UDF. An automatic
requery is done by Access
>when you change the record source.
>
>You can also use a view and set the Server Filter but
that's another story.
>
>I don't know (or understand) why you are moving your
combobox values to a
>text box.
>
>--
>Sylvain Lafontaine, ing.
>MVP - Technologies Virtual-PC
>
>
>"Ken" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message
>news:0c8401c54c64$ae933250$a401280a@xxxxxxxxxx
>>I have Access 2003. I recently installed SQL Server PE,
i
>> think it's version 8. I have created a database in the
>> Server and have opened a project and all of my tbles are
>> available.
>>
>> For over two weeks I have be trying to get things to
work
>> similar to what my access db did. I've tried function
>> queries, storedprocedure queries, and views and I cannot
>> figure out how to pass a value from a form to the query.
>>
>> Of course the old way was [Forms]![FormName]!
[FormField].
>>
>> What I do is, on a form, allow the user to make up to 15
>> account selections with a dollar threshold. Each
account
>> and dollar amount are selected from their respective
combo
>> box and that combo box value is then moved to a text
box.
>> A query is then run that uses these values, through the
>> criteria field, to pull the data from an appropriate
data
>> table. Then a report opens showing the user the results
>> of their search.
>>
>> After all of this my question is how do I pass these
>> values to a query using a Project? I cannot seem to get
>> any of the queries to accept the values from the form.
>>
>> Any help will be appreciated. I have read help topics
>> until my eyes have dried up.
>>
>> Thanks
>>
>> Ken
>
>
>.
>
.