query all controls on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm totally drawing a blank. Can someone help?
I need to build a query that queries 75 controls on a form.
Basically says if a control on the form is null, give me everything, but if
the control is not null, use that as criteria in the query grid.

The problem I have is that the user is not going to fill in all the fields
on the form.
And if I make my query criteria to the form control, if it's blank, the
resultset is no records.

G
 
?You have a form with 75 controls on it?

?And you are using that to build a query?!?

Perhaps if you described what you hope to accomplish, rather than how you
are approaching it, the 'group readers could offer alternate approaches...
 
Thank you Jeff for your quick response.

Unfortunately, yes to both questions.
The user has to be able to select whichever fields he wants to query on
(that will vary each time). I need to requery the subform based on the users
selections and then I have a button to export the resultset to EXCEL.

There are no drilldowns or shortcuts on this for me. This is what was
requested. And they want to see all the fields in the resultset.
There are text boxes that will have to have "like *xxx*", combo boxes, and
checkboxes.

I was going to use the buildcriteria method from the MSDN, but can't get it
to work in my db. It worked fine when I did it in the northwind db.
I tried a simple query in design view, setting the criteria for each field
to the form's corresponding control.
But when any of the fields have not been filled in, no records are included
in the resultset.

I'm really at a loss here, as to the best, fastest and simplest way to do
this.

G
 
Thanks Duane! I'll get right on it!
Quick question, it says can "select up to 30 fields from the master
query". Is that the limit? I need to be able to do 75. Can this be done?
G
 
If you think you need to select 75 fields to display then you will need to
make a couple modifications. I have trouble understanding the need to view
more than 30 fields but if this becomes an issue and you can't figure out
what to modify, then reply back...

--
Duane Hookom
MS Access MVP


G said:
Thanks Duane! I'll get right on it!
Quick question, it says can "select up to 30 fields from the master
query". Is that the limit? I need to be able to do 75. Can this be done?
G
 
Duane,
The user demands to be able to select from 50-75 fields, to get results,
even though I mentioned that it was not a good idea and that even Microsoft
professionals did not think it was a good idea.
I will need to look at it closer this evening. My new deadline is Sunday
noon. Sure appreciate your assistance on this, and everyone else's too!

G
 
My QBF solution allows you to "select from 50-75 fields". You would need to
modify some code and a form if you wanted to select more than 30 fields to
view.

Do you understand the difference?
 
I think so. I'll give it a try. Thanks!

G

Duane Hookom said:
My QBF solution allows you to "select from 50-75 fields". You would need to
modify some code and a form if you wanted to select more than 30 fields to
view.

Do you understand the difference?
 
Back
Top