Where Condition?? Help!!

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

Guest

Hi all,
I want to have a combo box on a form that has the following four values
NOTPAID;PARTPAID;FULLPAID
I have a field in a table that will be part query that makes up the form's
records source.
What I basically want it to happen is to have a command button cmdFilter
that will filter acording to the value selected from the combo values above.
If NOTPAID is selected the form should show everything that has that value
and likewise for everything.
I was looking up postings for triple state combo boxes and checkboxes but I
could not find anything that is near to what i want to do.
Can anyone point out the best way to filter a form that way?

thanks in advance
 
Let me make sure I understand you clearly here. You want to build a form to
display records, and you want to be able to filter them based on payment
status. I can think of two suggestions to help here.

Rather than try and use checkboxes or combo boxes, have you heard of an
option group? This is a control that lets you add two or more check boxes or
radio buttons to a group, one for each available choice in the grouping. The
grouping control then takes on the value of whatever choice is selected. In
this case, you would have three choices, "Not Paid", "Partially Paid", and
"Full Paid". It's up to you whether your table stores a 1,2 or 3 to
represent each choice, or if they store the actual text that spells out the
choice. As long as it's consistant, the option group will recognize the
value.

Secondly, do you know how to use a subform? A subform will accept filter
information from the main form, and display only records that are related to
what was selected on the main form. This is a Parent/Child relationship.

Here's what I would do - Build a form that shows all the information I want
displayed about the record. Name, address, amount paid, etc. Set it aside
for now, we'll use it later. Then, build a form with two controls on it, an
option group with the payment status choices in it, and a subform control.
Bind the subform control to the first form with the names, addresses, etc.
The first form shows up inside the subfrom control on the second form. Set
the parent child relationship to link the option group on the second form
(the parent) to the control on the first form that contains the payment
status information (the child).

You won't need a command button now, the filtering will happen in real time,
as you change from one choice to another in the option group
 

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

Back
Top