Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle button use to filter the current form when OnClick 2

Status
Not open for further replies.

SDRichardC

Technical User
Aug 18, 2010
15
0
0
US
I want to create three toggle buttons name
IQ, 4x6, and All. On the current form loaded, I want the user to click on one of the button which filters a combo box that holds the underlying table/query. Say if the IQ button is click, then the user goes to the field name Test Case combo box and drops down only those that is IQ related.
Here is what I have build in the table.

TestCase column = 1001, 1002, 1003...
TestName column = AC, Wallet, 8x12
TestType column = IQ, 4x6, All



I would greatly appreciate the help.
 
The easiest and probably most efficient would be to have stored queries to use as the rowsource of the combo
qryIQ
qry4x6
qryAll

on the click event of the button

Private sub cmdBtnIQ_click
me.yourComboBoxName.rowsource = "qryIQ"
end sub
 
cmbChoice would be a combo to select one of your options

me.filter="[Field]=me.cmbChoice"
me.filteron=true

 
BDCarillo, the OP wants to filter the rowsource of a combox not the records on a form.
 
MajP, the toggle buttons only, what EventProcedure do I put the code. OnClisk is not available. I tried putting it in the On Key press event.

Thanks for the quick response everyone.
 
Since toggle buttons have click events, I am guessing that you have an OptionGroup with toggle buttons, not individual toggle buttons. The option group is contained in a frame.
Normally this is done with the frames after update event and a select case. Each button in an option group returns the values 1,2, 3, .. the number of buttons. The value of the frame is the selected button.

dim strChoice as string
select case frameChoice.value
case 1
strChoice = "qryIQ"
case 2
strChoice = "qry4x6"
case 3
strChoice = "qryAll"
end select
me.yourComboBoxName.rowsource = strChoice
 
I have the query base on the field call cboJobNo.
What I want was to have the Operators click on one of the toggle buttons which filters the query where the cmdChoice is equals to the value as you have string: "qryIQ, qry4x6, and qryAll in the cmdChoice column.
The query have the column names as follows:
|Job No| Test| Size| cmdChoice| and I want the cboJobNo to show only those that was filtered by the toggle button click. I tried the groupOption and it is not working, i can't seem to code it right. Your help would be appreciated, again.
 
Sorry, I can not help. I can not make heads or tails of what you are asking.

Your naming convention makes no sense. According to you
"cboJobNo" which normally is a name of of combo box is the name of a field.
"cmdChoice" which normally is a name of a command button is the name of a field. More confusing this field is populated with names of queries.

I am not sure if this is a new or different question.
Post your database to a file sharing site and maybe someone will take a look. I use 4shared.com to post my databases.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top