Hiding a query

  • Thread starter vbnetman via AccessMonster.com
  • Start date
V

vbnetman via AccessMonster.com

Good afternoon,
I have a select query that is triggered by an event on a form. When the query
is triggered it appears on the screen. I would like to simply have it do its
own thing in the background, invisible to the user. Is there a way to hide
this when it runs?

Thank you
 
J

John Vinson

Good afternoon,
I have a select query that is triggered by an event on a form. When the query
is triggered it appears on the screen. I would like to simply have it do its
own thing in the background, invisible to the user. Is there a way to hide
this when it runs?

It's probably not necessary to "run" the query at all. What is the
purpose of this query? What is "its thing" and what do you want to
happen when the query is run?

Normally one would simply have a Query as the Recordsource of a form
or report, and open or requery that object when the query parameters
change.

John W. Vinson[MVP]
 
V

vbnetman via AccessMonster.com

The query looks at the highest reading for each meter replacement number. For
example, replacement 0 = 75, replacement 1 = 45 and replacement 2 = 60. It
then sums them for a total of 180. I am running the query on a click event
of a radio button for, in this example, meter 1. The result is then placed
into a "total" field, representing the total for that meter. Sure, if I could
do this without running the query, that would be great!


meterID replacementNumber meterRead
1 0
25
1 0
50
1 0
75
1 1
10
1 1
30
1 1
45
1 2
35
1 2
60

Thank you
 
V

vbnetman via AccessMonster.com

Oh, now that did not come out too good...
The query looks at the highest reading for each meter replacement number. For
example, replacement 0 = 75, replacement 1 = 45 and replacement 2 = 60. It
then sums them for a total of 180. I am running the query on a click event
of a radio button for, in this example, meter 1. The result is then placed
into a "total" field, representing the total for that meter. Sure, if I could
do this without running the query, that would be great!

meterID replacementNumber meterRead
1 0
25
1 0
50
1 0
75
1 1
10
1 1
30
1 1
45
1 2
35
1 2
60

Thank you
[quoted text clipped - 11 lines]
John W. Vinson[MVP]
 
J

John Vinson

Sure, if I could

Set the Total field's Control Source to

=DMax("[fieldname]", "[queryname]")

to find the maximum value and display it in the textbox.

John W. Vinson[MVP]
 
V

vbnetman via AccessMonster.com

Hi John,
Much much better - thank you for the direction, I was pulling out what's left
of my hair.

John said:
Sure, if I could

Set the Total field's Control Source to

=DMax("[fieldname]", "[queryname]")

to find the maximum value and display it in the textbox.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top