|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a query with teacher contact info: name/address -- plus about 7 different yes/no fields (classes taught - each field is a class, checked yes or no). I want the user to be able to "check" which class and view the teachers teaching that class.
Trying to get it to work in query form, but ultimately - a button from the main interface will take them to the critera form and produce the report, based on what they select. Is this the best way to do this -- and HOW? I've read about QBF with text boxes -- but what about yes/no? I always appreciate the help I get here - thanks in advance! -Heather ps -- I can't even get the [enter parameter box] to work for yes/no fields -- how does that work -- I guess you have to enter 0/1 or 0/-1 for yes no. That doesn't make sense for an end user. I need it easy-peasy. |
|
#2
|
|||
|
|||
|
Changed the method to my madness -- I've now created a form with a datasheet subform showing the teacher's contact data.
On the main form - cmd Buttons that filter by each of the fields. Each of my seven fields will have it's own filter button. I'm working a cmd button to preview filtered datasheet in a report -- but it doesn't work . . . .that's gonna be my next post! Thanks for viewing! |
|
#3
|
||||
|
||||
|
You would do much better to normalize your data. What you described is apparently a many-to-many relationship (each teacher may teach multiple classes, each class may be taught by multiple teachers), which requires 3 tables, not a string of Yes/No fields.
With a properly structured database, relationships like "show me all the teachers for this class" and "show me all the classes this teacher teaches" are dead simple.
__________________
Experience is the thing you have left when everything else is gone. |
|
#4
|
|||
|
|||
|
Thanks Don.
I know, I know. I hate that I set it up this way -- but with almost 200 teachers and plenty of data now, I hate to take the time to re-do everything. Changing reports, queries. . . . |
|
#5
|
||||
|
||||
|
Quote:
That's entirely up to you. Spend an hour now to do it correctly, or fight with a poorly structured database for the remainder of the life of the database and perhaps be unable to even do some things at all. |
|
#6
|
|||
|
|||
|
Quote:
Ugh. I know. I've had the problem before with the courses. I wonder if it is just an hour. I have so many reports based on the courses. . . . .with totals - how many teachers teaching how many courses - etc. Ya live and learn. The sad thing is my thinking when I originally built it. I thought - humph. I want the users to be able to check the check boxes on the form and created a field for each course. It wasn't logical thinking - it was "pretty" thinking. I can probably achieve the same look with the courses in their own table (in one field!) -- but I didn't even think about researching how to do that - at the time, figured it would have to be a drop-down box. . . .(When I was a newbie I always had trouble with multiple select fields like that though.) Ugh. Where were you when I started this thing! Thanks again. I appreciate your advice. Right now the db is pretty active. Once I get some quiet time, maybe I'll redo some things. |
|
#7
|
||||
|
||||
|
An hour is probably an underestimate, especially for someone who doesn't have a firm grip on relational database construction. It is not intuitive. Setting up the tables shouldn't take more than 15 minutes, but changing a number of queries will take a little longer. There shouldn't be major changes in forms and reports, perhaps new field names. Most of the work is in revising the queries.
You'll probably be able to populate the new 3rd table using carefully designed append queries, so you shouldn't have to manually enter all the data. But don't even start until you have studied and understand data normalization and many-to-many queries. Basically, your tables should look like this: Code:
tblTeachers: Tid Autonumber (PK) Tname Text Tphone Text tblCourses: Cid Autonumber (PK) Cname Text Croom Text Cstart Date Ctime Text Cunits Integer tblTeachers_Courses: Tid Long Integer (FK) Cid Long Integer (FK) |
|
#8
|
|||
|
|||
|
Quote:
THANK-YOU!! It could be awhile before I start making the changes. . .but I'll keep ya posted when I do! |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Forms - Use a form for query critera (yes/no boxes) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|