473,614 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Making a query based on radio button selections

56 New Member
I would like to make a form that creates a query.

I know that I could make a query for each radio button instance but that would take forever!

So basically what i have is 10 Fields in a query But the user may only need say 5 of them. Is there a way to "select/unselect" the "visible" check box in the query based on the radio buttons selected on the form?

sql for query is as follows:

<SELECT GenericRepList.[RepID#], vewEmployeeDeta ilInfoAll.Perso nFName & " " & vewEmployeeDeta ilInfoAll.Perso nLName AS RepName, vewEmployeeDeta ilInfoAll.Prima ryAddress1, vewEmployeeDeta ilInfoAll.Prima ryAddress2, vewEmployeeDeta ilInfoAll.Prima ryCity, vewEmployeeDeta ilInfoAll.Prima ryState, vewEmployeeDeta ilInfoAll.Prima ryZip, vewEmployeeDeta ilInfoAll.Phone Number, vewEmployeeDeta ilInfoAll.Email , vewEmployeeDeta ilInfoAll.Shirt SizeDescription
FROM GenericRepList LEFT JOIN vewEmployeeDeta ilInfoAll ON GenericRepList.[RepID#] = vewEmployeeDeta ilInfoAll.Perso nID
GROUP BY GenericRepList.[RepID#], vewEmployeeDeta ilInfoAll.Perso nFName & " " & vewEmployeeDeta ilInfoAll.Perso nLName, vewEmployeeDeta ilInfoAll.Prima ryAddress1, vewEmployeeDeta ilInfoAll.Prima ryAddress2, vewEmployeeDeta ilInfoAll.Prima ryCity, vewEmployeeDeta ilInfoAll.Prima ryState, vewEmployeeDeta ilInfoAll.Prima ryZip, vewEmployeeDeta ilInfoAll.Phone Number, vewEmployeeDeta ilInfoAll.Email , vewEmployeeDeta ilInfoAll.Shirt SizeDescription
ORDER BY GenericRepList.[RepID#];>

Any help would be greatly appreciated.
Jan 25 '08 #1
2 4322
jyoung2
32 New Member
Bold section is simmilar to what you are looking like Fairly sure with pure SQL you do not need the Parentheses I took this from an Access Query in sql view mode. My radial is called
[Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType]
it has 4 Values. It is linked to a subform.

[code]SELECT dbo_tblGiftCard s.*, tblTourn.TName, dbo_tblGiftEven t.fldGiftAmount
FROM (dbo_tblGiftCar ds LEFT JOIN tblTourn ON dbo_tblGiftCard s.fldTourID = tblTourn.TournI D) LEFT JOIN dbo_tblGiftEven t ON (dbo_tblGiftCar ds.fldTourID = dbo_tblGiftEven t.fldTournID) AND (dbo_tblGiftCar ds.fldCustID = dbo_tblGiftEven t.fldCustID)
WHERE ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=1) AND ((dbo_tblGiftCa rds.fldTourID)=[Forms]![frmSwipeEntry]![EventID])) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=2) AND ((dbo_tblGiftCa rds.fldTourID) Is Null) AND ((dbo_tblGiftCa rds.fldIssuedOn ) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=3) AND (Not (dbo_tblGiftCar ds.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=4)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=0 Or ([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType]) Is Null));[/CODE]

I would like to make a form that creates a query.

I know that I could make a query for each radio button instance but that would take forever!

So basically what i have is 10 Fields in a query But the user may only need say 5 of them. Is there a way to "select/unselect" the "visible" check box in the query based on the radio buttons selected on the form?

sql for query is as follows:

<SELECT GenericRepList.[RepID#], vewEmployeeDeta ilInfoAll.Perso nFName & " " & vewEmployeeDeta ilInfoAll.Perso nLName AS RepName, vewEmployeeDeta ilInfoAll.Prima ryAddress1, vewEmployeeDeta ilInfoAll.Prima ryAddress2, vewEmployeeDeta ilInfoAll.Prima ryCity, vewEmployeeDeta ilInfoAll.Prima ryState, vewEmployeeDeta ilInfoAll.Prima ryZip, vewEmployeeDeta ilInfoAll.Phone Number, vewEmployeeDeta ilInfoAll.Email , vewEmployeeDeta ilInfoAll.Shirt SizeDescription
FROM GenericRepList LEFT JOIN vewEmployeeDeta ilInfoAll ON GenericRepList.[RepID#] = vewEmployeeDeta ilInfoAll.Perso nID
GROUP BY GenericRepList.[RepID#], vewEmployeeDeta ilInfoAll.Perso nFName & " " & vewEmployeeDeta ilInfoAll.Perso nLName, vewEmployeeDeta ilInfoAll.Prima ryAddress1, vewEmployeeDeta ilInfoAll.Prima ryAddress2, vewEmployeeDeta ilInfoAll.Prima ryCity, vewEmployeeDeta ilInfoAll.Prima ryState, vewEmployeeDeta ilInfoAll.Prima ryZip, vewEmployeeDeta ilInfoAll.Phone Number, vewEmployeeDeta ilInfoAll.Email , vewEmployeeDeta ilInfoAll.Shirt SizeDescription
ORDER BY GenericRepList.[RepID#];>

Any help would be greatly appreciated.
Jan 25 '08 #2
scolivas
56 New Member
Thanks! I will give it a shot!




Bold section is simmilar to what you are looking like Fairly sure with pure SQL you do not need the Parentheses I took this from an Access Query in sql view mode. My radial is called
[Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType]
it has 4 Values. It is linked to a subform.

[code]SELECT dbo_tblGiftCard s.*, tblTourn.TName, dbo_tblGiftEven t.fldGiftAmount
FROM (dbo_tblGiftCar ds LEFT JOIN tblTourn ON dbo_tblGiftCard s.fldTourID = tblTourn.TournI D) LEFT JOIN dbo_tblGiftEven t ON (dbo_tblGiftCar ds.fldTourID = dbo_tblGiftEven t.fldTournID) AND (dbo_tblGiftCar ds.fldCustID = dbo_tblGiftEven t.fldCustID)
WHERE ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=1) AND ((dbo_tblGiftCa rds.fldTourID)=[Forms]![frmSwipeEntry]![EventID])) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=2) AND ((dbo_tblGiftCa rds.fldTourID) Is Null) AND ((dbo_tblGiftCa rds.fldIssuedOn ) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=3) AND (Not (dbo_tblGiftCar ds.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=4)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType])=0 Or ([Forms]![frmSwipeEntry]![fsubGiftCardLis ting].[Form]![togIssueType]) Is Null));[/CODE]
Jan 25 '08 #3

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

Similar topics

3
2458
by: Ferret Face | last post by:
Hello, I have a web page that gets the user to select items from a list of options. This list is a set of independant Radio Buttons. I did not use a Radio Button List because I wanted the possibility of multiple selections. However, one item is "None of the above" and I have placed some logic (autopostback, etc.) that will remove all previous selections if "None of the above" is chosen. My problem is this: This list of Radio Buttons...
1
8828
by: Jerry | last post by:
We have a 10-question quiz for kids, each question being a yes or no answer using radio selections. I'd like to keep a current total of yes's and no's at the bottom of the quiz (if the user selects yes to question 1, the total of yes's increases by 1). I've been searching for a while but I'm not sure I'm searching with the right keywords. Can anyone direct me to a source I can review to learn how to do this? Thanks! --
4
5343
by: biswaranjan.rath | last post by:
Hi, I've few checkboxes in different rows. After selecting appropriate values, the user should click a button. I wanted to convert those checkbox values to non-editable(or non-editable textboxes), so that user cannot change the value again after the needed functionality(this is in java script) completes. So my problem is that how should i manipulate the page through java script to set the field noneditable. Please suggest.
6
3659
by: loga123 | last post by:
I am using asp.net 2.0. I want to get the results of a sql query into an array at run-time. Number of records returned varies each time.....so I want to declare the dimensions of array runtime based on my record count and assign the values from recordset to the elements of array. any help?
5
1465
by: Dennis | last post by:
I'm sure there is an easy way to do what I want but I'm failing to find it... I have a single web page with links back to itself with set query strings... href="?data=x" href="?data=y"
10
6071
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
1
2401
by: Para | last post by:
Hi , I am working on a project using C/C++ in linux environment. Our program right now using the command line(console window) inputs and starts executing. command on console are to start program is, ./exe Please enter the selections( displays 1to 6 options) if either of them selected the program starts.
1
1910
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C Select Box 1
6
7023
by: jmarcrum | last post by:
Hi! I have created a Union Query in ACCESS 2003, that combines 130 records from one query (Extra Foreman Radios) and 250 records from another query (Forman Main Radios). I have created a continuous form and used the Union query (qryRadioDataUnion) as my record source. My question is...how would i apply a filter to that query record source to allow the user to limit the search results down to an individual contractor, radio type, SIM card...
0
8182
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8130
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8627
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8579
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8279
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
4052
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4127
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2568
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 we have to send another system
0
1425
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.