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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Merge - Access 2

Status
Not open for further replies.

DNH

MIS
Nov 12, 2004
2
MY
I have a one to many relationship, where one student may have more than one class. I would like to send each student a list of the classes they are taking for verification.

I ran this query:

SELECT DISTINCT student_id, course_name
FROM Student
GROUP BY student_id;

and here is part of the result:

523156978 Physics II
523156978 Calculas I
523156978 Statistics
554652586 Physics II
554652586 Calculas I

Is there a way to list all classes per student id on the same page?
 
DNH,

You can use the query as the source for a report. You can use the wizard and have it group by the student ID. This will list all classes per student ID without repeating the student ID. If you have student_id header format setting "Force New Page" set it to "Before Section", each student's ID and their list of courses will appear on their own pages. This isn't exactly a "mail-merge" though. Did you want to do a mail merge with Word? That's a little more complicated if you've never done it before.

I hope this helps!
-Mitchell
 
DNH (Visitor) Jan 24, 2001
I have a one to many relationship, where one student may have more than one class. I would like to send each student a list of the classes they are taking for verification.

I ran this query:

SELECT DISTINCT student_id, course_name
FROM Student
GROUP BY student_id;

and here is part of the result:

523156978 Physics II
523156978 Calculas I
523156978 Statistics
554652586 Physics II
554652586 Calculas I

Is there a way to list all classes per student id on the same page?


Mitchell (TechnicalUser) Jan 24, 2001
DNH,

You can use the query as the source for a report. You can use the wizard and have it group by the student ID. This will list all classes per student ID without repeating the student ID. If you have student_id header format setting "Force New Page" set it to "Before Section", each student's ID and their list of courses will appear on their own pages. This isn't exactly a "mail-merge" though. Did you want to do a mail merge with Word? That's a little more complicated if you've never done it before.

I hope this helps!
-Mitchell

Yes, I am trying to do a mail merge with Word. I have a document that I would like to insert the fields into. Is there a better option?
-DNH

 
You could use bookmarks in your document to have populated by Access. But you need to set up SQL statements and add the reference to Word Objects in the VBA Module. That is what I did to a predesigned document that needed tables and all different kinds of information.
 
if there is a maximum number of classes that one can take you might be better off making separate fields like period1, period2 etc. in the table, even though normally this is not advisable, in this case i think it's your best bet.
 
you can use a group header and set property to force new page. This way you could also put in student name, home room etc. Good luck and may God bless.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top