473,511 Members | 15,197 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filtering and creating a report

14 New Member
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
4 1342
NeoPa
32,557 Recognized Expert Moderator MVP
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
MMcCarthy
14,534 Recognized Expert Moderator MVP
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
  1.  
  2. Private Sub cmdPrint_Click()
  3. Dim stDocName As String
  4. Dim stLinkCriteria As String
  5.  
  6.     stDocName = "Report Name"
  7.     stLinkCriteria = "[program type]='" & Me.Combobox1 & "' AND [term year]=" & Me.Combobox2
  8.     DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria
  9.  
  10. End Sub
  11.  
  12.  
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
richard5150
14 New Member
Thanks guys!!!
all looks good now!
Nov 15 '06 #4
MMcCarthy
14,534 Recognized Expert Moderator MVP
Thanks guys!!!
all looks good now!
No problem.

Glad it worked out.
Nov 15 '06 #5

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

Similar topics

1
2640
by: diskoduro | last post by:
Hi! I'm trying to get help to an unexpected problem that has appeared while I was writing a new application. I want to opeon a report of product sales by filtering previously from a listbox in a...
0
1718
by: Scott Loupin | last post by:
I've got two databases with similar data in them (WestSide and EastSide). I've set up two identical reports that is filtered by date and the client name. I'm using one form to do the filtering. ...
15
4385
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
1
5227
by: mstery | last post by:
I have a report generated via an ID selection made in a dropdown on a form. The report filters by an on click event in a preview report button on the form. Everything in the report, including...
8
13498
by: | last post by:
hi, i have a form on which a user can choose specific criteria such as dates etc, in order to filter the report that is called from the form. i do this by using the Where section of the...
1
1644
by: pepsi330ml | last post by:
I have a Report A, which compute daily sales. Example: Date: 18 Jan 06 Pen - 4 pieces Ruler - 5 pieces Pencil - 7 pieces Date: 19 Jan 06 Pen - 3 pieces Ruler - 5 pieces
1
2302
by: jilppe | last post by:
I am creating a report based on a crosstab (BodyPart). This crosstab counts the number of incidents for each body part by month. However the data is for different years and I would like the user to...
3
1860
by: iamguyster | last post by:
Hi, I have an exercise I need to give to my pupils (I'm a teacher!) and I am trying to get a query working preferably using the query design view, without having to edit the SQL. The query involves...
3
5371
by: paquer | last post by:
On my Main form I have a Command Button that opens a Subform in order to create a new Subform record. At this point I want the subform to show only the new record being created. Not all the...
0
7349
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5659
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4734
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3219
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.