# Simple Access2000 ?

**URL:** <https://boards.straightdope.com/t/simple-access2000/158839>\
**Category:** Factual Questions\
**Created:** [March 3, 2003, 9:12pm UTC](https://boards.straightdope.com/t/simple-access2000/158839 "2003-03-03T21:12:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [March 3, 2003, 9:12pm UTC](https://boards.straightdope.com/t/simple-access2000/158839/1 "2003-03-03T21:12:23Z")

</div>

I have created a Query that I want to use in a text box on a form

For this, I added =Max([TestQuery]![N S1 Results]) in the Control Source of the text box.

TestQuery is the name of the Query. N S1 Results is the field that I want the Max function of.

No worky.

Access asks to ‘Enter Parameter Value’ for TestQuery!N S1 Results.

Any thoughts?

Thanks

---

<div class="post-metadata">

**Author:** ![Davebear](https://avatars.discourse-cdn.com/v4/letter/d/bcef8e/32.png) [@Davebear](https://boards.straightdope.com/u/Davebear)\
**Post date:** [March 3, 2003, 10:06pm UTC](https://boards.straightdope.com/t/simple-access2000/158839/2 "2003-03-03T22:06:29Z")

</div>

It sounds like your query is what actually needs the input. Do you get the same behavior when you open the query?

---

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [March 3, 2003, 10:12pm UTC](https://boards.straightdope.com/t/simple-access2000/158839/3 "2003-03-03T22:12:40Z")

</div>

> [@](#):
>
> \*Originally posted by Davebear \*  
> \*\*It sounds like your query is what actually needs the input. Do you get the same behavior when you open the query? \*\*

Nope, the query works fine.

This is my first shot at any access stuff, but I’ve done quite a bit of other programming.

I was wondering if it is the syntax in the form?

I do a dcount on the same query in the form and it works fine.

Thanks

---

<div class="post-metadata">

**Author:** ![BF](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@BF](https://boards.straightdope.com/u/BF)\
**Post date:** [March 3, 2003, 11:39pm UTC](https://boards.straightdope.com/t/simple-access2000/158839/4 "2003-03-03T23:39:54Z")

</div>

OK, just off the top of my head, what exactly are you trying to do? I read this as, if you have a form that gets one record at a time, your asking the field to perform an operation on that text box, ie., get max number from this table of this field. Do you want to use a list box or combo box instead?

---

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [March 3, 2003, 11:48pm UTC](https://boards.straightdope.com/t/simple-access2000/158839/5 "2003-03-03T23:48:16Z")

</div>

> [@](#):
>
> \*Originally posted by BF \*  
> \*\*OK, just off the top of my head, what exactly are you trying to do? I read this as, if you have a form that gets one record at a time, your asking the field to perform an operation on that text box, ie., get max number from this table of this field. Do you want to use a list box or combo box instead? \*\*

Ooops,

The text box is in a report, not a form. Basically all I want to do is return the MAX of a number field that is called by a query.

Sorry, mixed up forms with reports. Different code, different terms.

---

<div class="post-metadata">

**Author:** ![BF](https://avatars.discourse-cdn.com/v4/letter/b/b5ac83/32.png) [@BF](https://boards.straightdope.com/u/BF)\
**Post date:** [March 4, 2003, 12:10am UTC](https://boards.straightdope.com/t/simple-access2000/158839/6 "2003-03-04T00:10:56Z")

</div>

Ok, big difference. I just whipped up a table, query, form, report. With the query, here’s the SQL statement:  
SELECT DISTINCTROW Max(test\_table.alpha\_2) AS MaxOfalpha\_2  
FROM test\_table;  
I have three records in a dummy table, number field, and the report returns one record from the three with 250 in it. The other two records are 50 and 100. On the report, this is what the text box looks like:  
=Max(qry\_one!MaxOfalpha\_2)  
Of the three records, it only displays the 250.  
Is this what you’re looking for?

---

<div class="post-metadata">

**Author:** ![enipla](https://avatars.discourse-cdn.com/v4/letter/e/54ee81/32.png) [@enipla](https://boards.straightdope.com/u/enipla)\
**Post date:** [March 4, 2003, 12:31am UTC](https://boards.straightdope.com/t/simple-access2000/158839/7 "2003-03-04T00:31:14Z")

</div>

Yep,

The only difference I see is a lack of square brackets in your text box statement.

I’m not at work now, will give her a try tommorow.

I will also do a double check of the SQL call.

Thanks.
