Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

retrieving groups of records/filter?

Status
Not open for further replies.

hunterlpr

Technical User
Nov 15, 2002
15
US
Hoping someone can help because I'm confusing myself as to how to go about accomplishing this task, there may be a better/easier way to do this.

I have created a query from two tables that uses say the following fields

Classes tble, field Course Name
Enrollment tble, fields, course, last name, first name etc...

From this I developed a form thus having Classes as main form and enrollment as subform. This all works fine and gives me the info I want and how I want it however, the user still has to go through records in the main form using the record bar navigator

My question is how do I make course field, still using my query, become a combo or drop down box so the user can select the course.

Or is there an easier way such as just using my enrollment tble that uses a combo box associated with my classes tble, but then how would i filter..any help because I am really getting confused on how to do this..Thanks
 
You can put an unbound combobox in your main form. Then set it's data source as a query that only pulls your classes.
It should look something like this:

SELECT ClassName FROM TableName

-THis should display all of your classes

Then in the combobox's "After Update" event you would put in this code:

Me.RecordsetClone.FindFirst "[ClassName] = " & Me.ComboboxName
Me.Bookmark = Me.RecordsetClone.Bookmark

- This should then make the form go to the class record that the user selected.
- By the way, why are you joining the two tables together in a single query? Why not have different queries for each table, then create a different form for each table. Then you would simply add the enrollement form as a subform (you would link it by the course name)?

jbehrne

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Thank you so much for your reply. I originally had it set up with a form and subform, the problem with this was they had to scroll through the main form instead of selecting from a list(combo box) to see the records and I want them to be able to pick. Is there a way to do this.


Also I went ahead and put the select/from statement in my row source which worked out and showed a drop down list and now I'm debugging the after update event I'm getting a missing operand. Any ideas...which class field am I using by the way is it from Courses or enrollment table. Thanks again.
 
In your first paragraph I'm not sure what you want your db to do... (I have a db that shows how to select records from a dropbox - and then go to that record - if you send me an e-mail to: jbehrne@hotmail.com I'll be glad to send you a copy) Can you explain better? As for your second paragraph, please post your code and I'll look at it!

jbehrne

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top