473,498 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter Subform with Radio Buttons

35 New Member
Hello,

I am trying to change a filter for a subform (Default) that has a filter based on a drop down box with a Search button to a filter based on radio buttons.

However, I don't understand the current query enough to begin to change it. Here is the command that opens the query which has a subquery as well.

Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenQuery ("QryAccounts")
Here is the part of the query I am having difficulty with:

Expand|Select|Wrap|Line Numbers
  1. FROM QryAccountsSub 
  2.    LEFT JOIN ActiveUsers 
  3.       ON QryAccountsSub.[Account Number] 
  4.          = ActiveUsers.[Account Number]
  5. WHERE ((
  6.    (QryAccountsSub.[Account Number])
  7.       =IIf(IsNull([Forms]![Default]![Account])
  8.          ,[QryAccountsSub].[Account Number]
  9.          ,([Forms]![Default]![Account]))) 
  10.        AND 
  11.          ((QryAccountsSub.QQ)
  12.             =IIf(IsNull([Forms]![Default]![st])
  13.             ,[QQ]
  14.             ,IIf([Forms]![Default]![st]="All"
  15.                ,[QQ]
  16.                ,IIf([Forms]![Default]![st]="Pre-Installed"
  17.                   ,1
  18.                   ,IIf([Forms]![Default]![st]="Q Accounts"
  19.                      ,0
  20.                      ,[QQ]))))) 
  21.        AND
  22.           ((QryAccountsSub.Act)
  23.             =IIf(IsNull([Forms]![Default]![st])
  24.             ,1
  25.             ,IIf([Forms]![Default]![st]="All"
  26.                ,[Act]
  27.                ,IIf([Forms]![Default]![st]="Active Accounts"
  28.                   ,1
  29.                   ,[Act])))) 
  30.        AND ((QryAccountsSub.LL)
  31.             =IIf(IsNull([Forms]![Default]![st])
  32.                ,[LL]
  33.                ,IIf([Forms]![Default]![st]="All"
  34.                   ,[LL]
  35.                   ,IIf([Forms]![Default]![st]="Pre-Installed"
  36.                   ,1
  37.                   ,[LL])))))
Here is the subquery:
Expand|Select|Wrap|Line Numbers
  1. SELECT Accounts.*
  2.    , IIf(IsNull([Q Date])
  3.          ,1
  4.          ,0)
  5.     AS QQ
  6.    , IIf(IsNull([Live Date])
  7.          ,1
  8.          ,0) 
  9.     AS LL
  10.    , IIf(IsNull([Q Date]) 
  11.          And [Live Date]<Date()+20
  12.             ,1
  13.             ,0)
  14.     AS Act
  15. FROM Accounts
  16. ORDER BY Accounts.[Account Number];
The combo box is named st and has 4 values: "All";"Pre-Installed";"Q Accounts";"Active Accounts.

Can anyone give me some insight into where/how to change values so that I can change from a combo box to radio buttons? Also, is there any way to simplify this? Thanks!
Aug 23 '14 #1
2 1471
rhonda6373
35 New Member
Hello,

I figured this out. Rather than trying to understand this query, I just replaced the values "All";"Pre-Installed";"Q Accounts";"Active Accounts" in the query with 1,2,3,4 and renamed the radio button frame to st. It appears to work.

Thanks!
Aug 24 '14 #2
zmbd
5,501 Recognized Expert Moderator Expert
Sorry, late to the party. (^_^)
Radio controls as set up in a frame control return a numeric value to the frame. This why your 1,2,3,4 worked in the query.
Aug 27 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
6127
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
2
3119
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as...
4
3245
by: Oscar Monteiro | last post by:
I Have to sets of Radio buttons like so: <input type="radio" name=p1 value=1> <input type="radio" name=p1 value=2> <input type="radio" name=p1 value=3> <br> <input type="radio" name=p2 value=1>...
2
11920
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
2
5876
by: dpazza | last post by:
Hi, I'm creating a quiz on using a form in VB 2005 express. I have four sets of questions and answers (labels and radio buttons) and I change between which set of questions is currently shown on...
4
2501
by: Blasting Cap | last post by:
I have a page that has a number of radio buttons that will be displayed to different access levels of a user who logs in to my website. For instance, if there are a dozen buttons, user1 will see...
6
5044
by: yajiv.vijay | last post by:
I am just started using getElementsByTagName. I dont know how to filter radio buttons from all other INPUT fields. Is there any way to do that without looping through all the INPUT fields?
11
2255
by: Twayne | last post by:
Hi, Newbie to PHP here, no C or other relevant background, so pretty niave w/r to the nuances etc. but I think this is pretty basic. XP Pro, SP2+, PHP 4.4.7, XAMPP Local Apache Server...
7
4330
by: gengyue | last post by:
Hi, I am running a report using Cold Fusion. This report is generated by cfloop tag. Depends on the record count of a query, the report will list the data retrieved from the database. each row in...
11
5747
by: Jody Cliffe | last post by:
Hi. Im trying to program my radio buttons to filter data for student pass/fail in a sub form called I have using help found here got this far but its not working and Im not sure why. my radio...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7203
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
4908
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4588
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1417
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
290
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.