Generating a report from selected records from a datasheet form

Essendon

Registered User.
Local time
Today, 18:16
Joined
Oct 25, 2001
Messages
65
G'day from Australia.

I have a report that will show all the students from a certain school (obtained via a query). There is a combo box, and the user simply selects the name of school from that combo box and all students from that school are obtained via a query to be shown in the report. However, the user needs to be able to pick out a specific few records only from each school to be shown in the report.

Does anybody have any ideas on what would be the best way of doing this?

I have considered the following: when the user selects a school from the combo box, a list of the students of that school is shown on a form and the user then selects the students required in the report via a checkbox...then the user clicks a button to view the students with the checkbox ticked....(obtained via another query I guess). Would this be a good way of doing it?

Thanks in advance,

Peter
 
How about selecting the school from the Combo box and have the student names placed into a List box. From there use this article to get the student names selected in the List box to be the basis for the Report.

http://support.microsoft.com/support/kb/articles/Q135/5/46.asp?LN=EN-US&SD=gn&FR=0&qry=How%20to%20Use%20a%20Multi-Select%20List%20Box%20to%20Filter%20a%20Form&rnk=1&src=DHCS_MSPSS_ gn_SRCH&SPR=ACC

Use this article to fill the student names into the List box.

http://support.microsoft.com/support/kb/articles/Q209/5/76.ASP?LN=EN-US&SD=gn&FR=0&qry=q209576&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=ACC2000
 
Peter:

Are the factors that determine if the user will "check" a student's name RANDOM or is the user to "check" of names of students that have other criteria that may be present in the tables?

Reason for asking:

You can set cascading combos or combo/list boxes in series to create values to reference in a query.

Your idea is good too, but if the data is there, use it! Still, if you wanted to go the check box option, you will need to add a field to that student table, a yes/no field, so that you have some value to check against in a query. Otherwise, you will have to run code to loop through all the checkboxes to see if they are checked or not and then more code to print only those checked.


Hope that helps you with your decision.
 
The values of the check box would be random.

The combo/list box sounds like the way to go...

Thanks for you help...
 
Im having a bit of trouble getting it to work.

With reference to the following code:

Set Q = DB.QueryDefs("MultiSelect Criteria Example")
Q.SQL = "Select * From Commercial Where [ID] IN(" & Criteria & _
");"
Q.Close

' Run the query.
DoCmd.OpenQuery "MultiSelect Criteria Example"

note: the IN statement will end up looking like: IN("34","54","67"..etc...)...

If have tracked the error down to the fact that the IN(....) statement wont work because [ID] is an autonumber. The help file has help topics for In(), but for some reason I cannot get them to display!

Does anybody know if there are any ways to get around this problem?

Thankyou

Peter

[This message has been edited by Essendon (edited 11-28-2001).]

[This message has been edited by Essendon (edited 11-28-2001).]
 

Users who are viewing this thread

Back
Top Bottom