Help with Query

J

James

Hello I would like some assistance in creating a query....

I would like the query to run within a text box...

Ok I have 3 combo boxes...

and dependant on either one of the combo box values or all
of them I would like it to state how many records are in
the database...

So for example...

cbo1 = Male...

In the text box it would say how evr many males there are
in the database...

or it would do the following...

cbo1 = Male
cbo2 = q01

It would tell me how many Males have answered Question 1

or it could do this:

cbo1 = male
cbo2 = Q01
cbo3 = True

The text box would now tell me how many Males have
answered True to Question 1....

How do I go about creating my query and also how do I get
my text box to respond to the cbo boxes as there given
values it updates the text box...

How could this be done??

Many Thanks

James
 
G

Guest

I think you'd have to write vb code to accomplish this.
You also need some sort of event to trigger the code to
execute, maybe a button to press. Then, you could attach
your vb code to the on click property of the button.

HTH
 
G

Guest

You would want to add a command button on your form.
After the combo boxes are set by the user, they could
press the command button to process. The command button
has properties associated with it. You can set the "ON
CLICK" property to "Event Procedure". This is where your
code would be.

If not IsNull(Forms![Your Form]![cb01]) Then
'you know there is something in here.
If not IsNull(Forms![Your Form]![cb02]) Then
'you know there is something in here.
'Then, build your query based on your criteria
 
J

James

Ok I am not the best with VB code nor am I good with
SQL... please could you assist further??

Many Thanks

James
-----Original Message-----
You would want to add a command button on your form.
After the combo boxes are set by the user, they could
press the command button to process. The command button
has properties associated with it. You can set the "ON
CLICK" property to "Event Procedure". This is where your
code would be.

If not IsNull(Forms![Your Form]![cb01]) Then
'you know there is something in here.
If not IsNull(Forms![Your Form]![cb02]) Then
'you know there is something in here.
'Then, build your query based on your criteria


-----Original Message-----
WHat code would I need and where would I need to put it??

Many Thanks

James

.
.
 

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