Filter form data based on radio button selection

  • Thread starter Thread starter abev107
  • Start date Start date
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
 
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
 
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.
 
Back
Top