Query (Filtering?) in a Form

bobhra

New member
Local time
Today, 09:08
Joined
Jan 9, 2011
Messages
3
Hello,
I am beginner in Access and besides that 2007 design makes no sense at all.

Situation:
I have 2 tables

Courses
--------
CourseID - primary, text
Capacity - number
Tutor - text

Books
--------
ISBN - primary, text
Title - text
Author - text
CourseID - text, foreign key

Scenario: The DB represents each course that has its own recommended books.
I created One-to-Many relationship between Courses and Books tables as there may be several books recommended for one course and only one course for each book.

Then I faced a problem - I need to design a form for querying recommended book information for any course that the user choices. Only the CourseID must be provided by the user, and course tutor, book title and author must be displayed. I need to use sub-forms as there will be many books recommended for one course, so all relevant information (and there may be really loads of rows) must be displayed in a grid sub-form.
And I spent 2 days in a row trying to do it. It involved creating buttons and assigning filtering actions to them, playing around with object properties and so on. Nothing helped. I am pretty sure it can be achieved without using VB code as this task is really basic.

To make everything more clear I attached the draft DB. Hope this helps. It has a form with a button to filter the form (near courseID field). Sub-form information updates, but not the Tutor field.

Thank you in advance ;)
 

Attachments

Last edited:
The database supplied only has the Tables so it is a little difficult to see what you are trying to achieve.

Simon
 
Is there some reason you do not want to use VBA code for this? Is this for a class your taking that requires you not to use VBA? A parameter query might give you want you want without VBA although it isn't a very elegant solution.

You mentioned that you need "course tutor, student id and full names [] displayed". You also mentioned that you need "all relevant information (and there may be really loads of rows)". Many rows is not a problem at all here. Do you need more fields showing in this form/query than the three you've listed above?

This really isn't all that difficult to accomplish at all but it's far from clear what you're looking for. I've attached a sample that might work for you. It does use about four lines of VBA code to set the filter. It does not use a parameter query as I've suggested above. I'm not too fond of parameter queries.
 

Attachments

Thank you, I really appreciate you paid attention to my question.
Yes, sad to say, but it is for my classes. I am required to make a form, so using [Please enter course code] for criteria in queries or a combo box is not what I am required. And VBA cannot be used as well.
I updated the information a bit to make it more close to what is needed and updated the attachment with my form.
Thank you for the patience ;)
 
I'm really confused now about what your question is or what you are trying to achieve.

>I am required to make a form, so using [Please enter course code] for criteria in queries or a combo box is not what I am required.

Is there any requirement that you cannot use VBA code?
 
Unfortunately.
Well, what I need is pretty much in the database attached. The only problem with it is that when I press the button to filter the form by courseID only sub-form updates. Not the Tutor field.
 

Users who are viewing this thread

Back
Top Bottom