Filter form data based on radio button selection

A

abev107

I have a form (continuous forms view) with an option group (fiv
options) in the form header. I would like to limit the data on the for
based on the radio button selected.

I am creating an employee scheduling db. The radio's in the optio
group are locations, and I would like to limit the shifts (detai
section) based on the location selected
 
N

Nikos Yannacopoulos

Open your form in design view, select your option group and in properties,
tab Events, put the cursor i line for On Change and click on the little
button with the three dots on the right hand side.Select Code Builder, and
when in the code editor window, put the line below between the "Private Sub
xxxx_Change(cancel as integer)" and "End Sub" lines that access generates
automatically:

DoCmd.ApplyFilter , "Location_ID = " & Me.OptLocation

assuming:
Location field name on form: Location_ID
Option Group name: OptLocation
Substitute as appropriate.

HTH,
Nikos
 
Joined
May 21, 2009
Messages
2
Reaction score
0
Nikos,


Reading your solution below i believe you can help me also (i pray you can)



I have created a form to log all issues that users of a system have called in about.



when i get a call i bring up the form which has a username field



This username field reference all users of teh system (users table)



The form also has 3 radio status buttons "Active", "Inactive" and "All"



Before i start to input a username into the form i require selecting one of those radio buttons to state whether i want to search on active / inactive or all users that are stored on teh users table.



In the users table there is a column called status which states whether a user is active or iunactive.



The problem is i have no idea on how i can link them



any support would be greatly appreciated.



Thanking you in advance.
 

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