Using a Toggle button to input criteria

DJ-Specter

Registered User.
Local time
Today, 21:25
Joined
Sep 19, 2009
Messages
21
Hi I'm trying to create a system for a multiple inputable criteria query and I need to use a toggle button to use as an interface to create a query and input a criteria. any ideas? thanks
 
Can you explain a little more as to what you expect the user to see/do?
 
I have separate forms and querys for individual age ranges (16-24, 25-34 etc), gender, ethnicity and disabilities all with buttons on a single page that bring up all people conforming to the individual profiling method. I'm trying to replace the command buttons with toggle buttons so that when they're pressed, they input the results of the query/form to a different master query essentially allowing me to view for example all females aged 25 and who are caucasian.
 
I think you are overdoing it a bit can you send a copy of your mdb or some screen shots to look at.

David
 
I think you are overdoing it a bit can you send a copy of your mdb or some screen shots to look at.

David

how do I post an image as an attachment if its not hosted on the net and only on my hd? - there's no attchment option on the message posting box.
 
Click on the Post Reply button....not the quick Reply. You will see a button with a paper clip.

Also note that if you are using Acess 2007, you will get more responses if you post it in MDB format as not everybody is using Access 2007.
 
Thanks for that last post!

The first picture (multiple criteria....jpg) shows my current master form with all the profiling buttons. the second (age form.....jpg) shows the form that is brought up when a button is clicked on. I want to turn the command buttons into toggle buttons and use them as criteria for a master query enabling me to search all users aged 35-44 who are male and diabled for example.

This has been killing me for days now and i'm totally at a loss - any ideas welcomed!

thanks
 

Attachments

  • Multiple Criteria form shot.jpg
    Multiple Criteria form shot.jpg
    99.4 KB · Views: 202
  • age form example.jpg
    age form example.jpg
    99.9 KB · Views: 245
What you want to do is certainly doable...but a few questions need to be asked first IMHO.

1. Is the age static, or based off of their DOB? The reason I ask is that in the future, if it's static, it could present problems. As the years go by, the age obviously will increase and can push a person from one range to another. If that doesn't affect anything, then you are fine.

So, assuming that the age is static, what you want to do is have an Options Group with the ranges you want to query by. When creating the Options group, all you will need is to assign a value to each Option. You can put the Age Range in the label. Then,in code, you can then use the value of the Option group in a Select Case to determine the WHERE portion of the Sql. Quick air code:

Code:
Dim iAgeRange as Integer
dim sWhereClause, sSql as string
 
sSql = "Select tblTableName.*, tblTableName.Age From tblTableName"
Case Select iAgeRange
      Case 1
        sWhereClause = " ((WHERE ([Age] => 16) and ([Age] =< 24));"
      Case 2
        sWhereClause = " ((Where [Age]) => 25 and ([Age] =< 34));"
(Add the rest of the Cases)
end Select
 
sSql = sSql & sWhereClause
 
'Open up the form, set the recordset to equal sSql
 

Users who are viewing this thread

Back
Top Bottom