473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Making a query based on radio button selections

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#], vewEmployeeDetailInfoAll.PersonFName & " " & vewEmployeeDetailInfoAll.PersonLName AS RepName, vewEmployeeDetailInfoAll.PrimaryAddress1, vewEmployeeDetailInfoAll.PrimaryAddress2, vewEmployeeDetailInfoAll.PrimaryCity, vewEmployeeDetailInfoAll.PrimaryState, vewEmployeeDetailInfoAll.PrimaryZip, vewEmployeeDetailInfoAll.PhoneNumber, vewEmployeeDetailInfoAll.Email, vewEmployeeDetailInfoAll.ShirtSizeDescription
FROM GenericRepList LEFT JOIN vewEmployeeDetailInfoAll ON GenericRepList.[RepID#] = vewEmployeeDetailInfoAll.PersonID
GROUP BY GenericRepList.[RepID#], vewEmployeeDetailInfoAll.PersonFName & " " & vewEmployeeDetailInfoAll.PersonLName, vewEmployeeDetailInfoAll.PrimaryAddress1, vewEmployeeDetailInfoAll.PrimaryAddress2, vewEmployeeDetailInfoAll.PrimaryCity, vewEmployeeDetailInfoAll.PrimaryState, vewEmployeeDetailInfoAll.PrimaryZip, vewEmployeeDetailInfoAll.PhoneNumber, vewEmployeeDetailInfoAll.Email, vewEmployeeDetailInfoAll.ShirtSizeDescription
ORDER BY GenericRepList.[RepID#];>

Any help would be greatly appreciated.
Jan 25 '08 #1
2 4290
jyoung2
32
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]![fsubGiftCardListing].[Form]![togIssueType]
it has 4 Values. It is linked to a subform.

[code]SELECT dbo_tblGiftCards.*, tblTourn.TName, dbo_tblGiftEvent.fldGiftAmount
FROM (dbo_tblGiftCards LEFT JOIN tblTourn ON dbo_tblGiftCards.fldTourID = tblTourn.TournID) LEFT JOIN dbo_tblGiftEvent ON (dbo_tblGiftCards.fldTourID = dbo_tblGiftEvent.fldTournID) AND (dbo_tblGiftCards.fldCustID = dbo_tblGiftEvent.fldCustID)
WHERE ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=1) AND ((dbo_tblGiftCards.fldTourID)=[Forms]![frmSwipeEntry]![EventID])) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=2) AND ((dbo_tblGiftCards.fldTourID) Is Null) AND ((dbo_tblGiftCards.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=3) AND (Not (dbo_tblGiftCards.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=4)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=0 Or ([Forms]![frmSwipeEntry]![fsubGiftCardListing].[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#], vewEmployeeDetailInfoAll.PersonFName & " " & vewEmployeeDetailInfoAll.PersonLName AS RepName, vewEmployeeDetailInfoAll.PrimaryAddress1, vewEmployeeDetailInfoAll.PrimaryAddress2, vewEmployeeDetailInfoAll.PrimaryCity, vewEmployeeDetailInfoAll.PrimaryState, vewEmployeeDetailInfoAll.PrimaryZip, vewEmployeeDetailInfoAll.PhoneNumber, vewEmployeeDetailInfoAll.Email, vewEmployeeDetailInfoAll.ShirtSizeDescription
FROM GenericRepList LEFT JOIN vewEmployeeDetailInfoAll ON GenericRepList.[RepID#] = vewEmployeeDetailInfoAll.PersonID
GROUP BY GenericRepList.[RepID#], vewEmployeeDetailInfoAll.PersonFName & " " & vewEmployeeDetailInfoAll.PersonLName, vewEmployeeDetailInfoAll.PrimaryAddress1, vewEmployeeDetailInfoAll.PrimaryAddress2, vewEmployeeDetailInfoAll.PrimaryCity, vewEmployeeDetailInfoAll.PrimaryState, vewEmployeeDetailInfoAll.PrimaryZip, vewEmployeeDetailInfoAll.PhoneNumber, vewEmployeeDetailInfoAll.Email, vewEmployeeDetailInfoAll.ShirtSizeDescription
ORDER BY GenericRepList.[RepID#];>

Any help would be greatly appreciated.
Jan 25 '08 #2
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]![fsubGiftCardListing].[Form]![togIssueType]
it has 4 Values. It is linked to a subform.

[code]SELECT dbo_tblGiftCards.*, tblTourn.TName, dbo_tblGiftEvent.fldGiftAmount
FROM (dbo_tblGiftCards LEFT JOIN tblTourn ON dbo_tblGiftCards.fldTourID = tblTourn.TournID) LEFT JOIN dbo_tblGiftEvent ON (dbo_tblGiftCards.fldTourID = dbo_tblGiftEvent.fldTournID) AND (dbo_tblGiftCards.fldCustID = dbo_tblGiftEvent.fldCustID)
WHERE ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=1) AND ((dbo_tblGiftCards.fldTourID)=[Forms]![frmSwipeEntry]![EventID])) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=2) AND ((dbo_tblGiftCards.fldTourID) Is Null) AND ((dbo_tblGiftCards.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=3) AND (Not (dbo_tblGiftCards.fldIssuedOn) Is Null)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=4)) OR ((([Forms]![frmSwipeEntry]![fsubGiftCardListing].[Form]![togIssueType])=0 Or ([Forms]![frmSwipeEntry]![fsubGiftCardListing].[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
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...
1
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...
4
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...
6
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...
5
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
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...
1
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...
1
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 ...
6
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...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.