Hiding a Query

K

Ken Snell \(MVP\)

Why are you displaying a query at all as a separate query object? You should
display the results of a query on a form.

Can you tell us more about your setup and what you're trying to do?
 
W

williamr

I have a form that runs the query but when it runs, it opens the query, I
don't want it to been seen. I only want the query to filter, then store the
information.
 
K

Ken Snell \(MVP\)

Tell us more information so that we can suggest how to do what you want.
What does the query do, what do you want to do with the results of the
query, how do you want to store the data from the query, etc.?
 
W

williamr

This is what I did. I have a form that ask for the VaultNo, After clicking
continue it opens the query, applying a filter to return 1 record. Then I
store some of the fields in that query to some variables. It seams to work
but after I click continue on the form the query opens and you see it. I
don't want to see anything until the data is put into a print-preview word
document.

DoCmd.OpenQuery ("qryBill")
DoCmd.ApplyFilter , "[vault No] = " & lngReleaseNumber
xDeveloperName = DLookup("[developername]", "qrybill", _
"[vault no] = " & lngReleaseNumber)
 
K

Ken Snell \(MVP\)

I am not understanding what purpose / use the qryBill query has for what
you're doing to filter the form? Why do you open that query? Your form
cannot use it when it's opened, and your code is not referencing it at all
after it's opened.

What happens if you just leave out the OpenQuery step?
--

Ken Snell
<MS ACCESS MVP>




williamr said:
This is what I did. I have a form that ask for the VaultNo, After
clicking
continue it opens the query, applying a filter to return 1 record. Then
I
store some of the fields in that query to some variables. It seams to
work
but after I click continue on the form the query opens and you see it. I
don't want to see anything until the data is put into a print-preview word
document.

DoCmd.OpenQuery ("qryBill")
DoCmd.ApplyFilter , "[vault No] = " & lngReleaseNumber
xDeveloperName = DLookup("[developername]", "qrybill", _
"[vault no] = " & lngReleaseNumber)

Ken Snell (MVP) said:
Tell us more information so that we can suggest how to do what you want.
What does the query do, what do you want to do with the results of the
query, how do you want to store the data from the query, etc.?
 
W

williamr

Duh...... That works just fine!!!
Thank You

Ken Snell (MVP) said:
I am not understanding what purpose / use the qryBill query has for what
you're doing to filter the form? Why do you open that query? Your form
cannot use it when it's opened, and your code is not referencing it at all
after it's opened.

What happens if you just leave out the OpenQuery step?
--

Ken Snell
<MS ACCESS MVP>




williamr said:
This is what I did. I have a form that ask for the VaultNo, After
clicking
continue it opens the query, applying a filter to return 1 record. Then
I
store some of the fields in that query to some variables. It seams to
work
but after I click continue on the form the query opens and you see it. I
don't want to see anything until the data is put into a print-preview word
document.

DoCmd.OpenQuery ("qryBill")
DoCmd.ApplyFilter , "[vault No] = " & lngReleaseNumber
xDeveloperName = DLookup("[developername]", "qrybill", _
"[vault no] = " & lngReleaseNumber)

Ken Snell (MVP) said:
Tell us more information so that we can suggest how to do what you want.
What does the query do, what do you want to do with the results of the
query, how do you want to store the data from the query, etc.?
--

Ken Snell
<MS ACCESS MVP>


I have a form that runs the query but when it runs, it opens the query,
I
don't want it to been seen. I only want the query to filter, then
store
the
information.

:

Why are you displaying a query at all as a separate query object? You
should
display the results of a query on a form.

Can you tell us more about your setup and what you're trying to do?
--

Ken Snell
<MS ACCESS MVP>




Can a query be hidden using the visible = false command?

Thanks in advance
 
Top