Toggle Button to filter combobox

G

Guest

I have a filter set up on a combobox that I would like to enable and disable
using a toggle button. How would I do this?

Thanks

Dave
 
G

Guest

Hey Dave, you didn't give much details for me to work with.

I have a few forms like this one:

First I create a Function called FilterData().

Function FilterData()
dim strFilter as string

if Toggle1 = true then
strfilter = "[MyFiled] = " & Combo2
else
strFilter = ""
endif

me.filter = strFilter
me.Filteron = true
end if

And would put on the event onChange of the Toggle button and combobox:
=FilterData()

Any change on the combo or toggle value, will refresh the filter

Does it help?

Mauricio Silva
 
G

Guest

Thanks, I'll give it a go

Mauricio Silva said:
Hey Dave, you didn't give much details for me to work with.

I have a few forms like this one:

First I create a Function called FilterData().

Function FilterData()
dim strFilter as string

if Toggle1 = true then
strfilter = "[MyFiled] = " & Combo2
else
strFilter = ""
endif

me.filter = strFilter
me.Filteron = true
end if

And would put on the event onChange of the Toggle button and combobox:
=FilterData()

Any change on the combo or toggle value, will refresh the filter

Does it help?

Mauricio Silva

David M C said:
I have a filter set up on a combobox that I would like to enable and disable
using a toggle button. How would I do this?

Thanks

Dave
 
G

Guest

Not quite what I wanted. The combobox itself is filtered. (ie, rather than
showing all EmployeeNames, it shows only those Employees that are in the RMI
department). I want to access the FilterOn properties of the combobox.
Enabling and disabling the filter using the toggle button.

Ideas?

Thanks,

Dave

Mauricio Silva said:
Hey Dave, you didn't give much details for me to work with.

I have a few forms like this one:

First I create a Function called FilterData().

Function FilterData()
dim strFilter as string

if Toggle1 = true then
strfilter = "[MyFiled] = " & Combo2
else
strFilter = ""
endif

me.filter = strFilter
me.Filteron = true
end if

And would put on the event onChange of the Toggle button and combobox:
=FilterData()

Any change on the combo or toggle value, will refresh the filter

Does it help?

Mauricio Silva

David M C said:
I have a filter set up on a combobox that I would like to enable and disable
using a toggle button. How would I do this?

Thanks

Dave
 
G

Guest

Figured it out. The combobox doesn't have a Filter property (duh). Changed
the rows source instead, with the toggle button altering the sql accordingly.

David M C said:
Not quite what I wanted. The combobox itself is filtered. (ie, rather than
showing all EmployeeNames, it shows only those Employees that are in the RMI
department). I want to access the FilterOn properties of the combobox.
Enabling and disabling the filter using the toggle button.

Ideas?

Thanks,

Dave

Mauricio Silva said:
Hey Dave, you didn't give much details for me to work with.

I have a few forms like this one:

First I create a Function called FilterData().

Function FilterData()
dim strFilter as string

if Toggle1 = true then
strfilter = "[MyFiled] = " & Combo2
else
strFilter = ""
endif

me.filter = strFilter
me.Filteron = true
end if

And would put on the event onChange of the Toggle button and combobox:
=FilterData()

Any change on the combo or toggle value, will refresh the filter

Does it help?

Mauricio Silva

David M C said:
I have a filter set up on a combobox that I would like to enable and disable
using a toggle button. How would I do this?

Thanks

Dave
 

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