By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,646 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Filtering and creating a report

P: 14
Access Version: 2003
OS: Windows XP

I have created 2 tables. The first table includes the students name, students ID and program type (ie: either JD or LLM). The second table includes the students ID, GPA and term year. I have created a query that pulls information from both tables. Works good, no problem there.
What I would like to do is create a form which includes 2 combo box's (1st combo box: program type, 2nd combo box: term year) and create a report with that specific information.
Any help is appreciated!
Nov 10 '06 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 15k+
P: 31,273
From what detail you've given, I would say build a form bound to the query you mentioned. The report too, should be built on this same query.
Nov 11 '06 #2

Expert Mod 10K+
P: 14,534
As NeoPa says create the report on the full query.

Then in the code behind the print button (cmdPrint for this example) change it to set a filter as follows:

Expand|Select|Wrap|Line Numbers
  2. Private Sub cmdPrint_Click()
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  6.     stDocName = "Report Name"
  7.     stLinkCriteria = "[program type]='" & Me.Combobox1 & "' AND [term year]=" & Me.Combobox2
  8.     DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
  10. End Sub
I assumed program type was a text field which is why it's enclosed in single quotes and that term year was a number so it's not.
Nov 12 '06 #3

P: 14
Thanks guys!!!
all looks good now!
Nov 15 '06 #4

Expert Mod 10K+
P: 14,534
Thanks guys!!!
all looks good now!
No problem.

Glad it worked out.
Nov 15 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.