I have a database that keeps up with certifications for various employees. I need to be able to choose a particular employee (no problem with that) and then I need that data to be exported into a PDF form. The form has the employee id, name, status, instructor and method at the top and then lists the certification, description and expiration date in the body of the form. The problem I am having is that if I export the query to an .XML file, I get breaks in the record instead of getting all of the certifications in one file. I figure I need to do something like a loop of the query and change the field names to Cert1, Desc1, ExpDate1, Cert2, Desc2, ExpDate2, etc and continue looping until all the records are there. However, I have NO idea how to do this. The number of certifications will not be the same for each employee, and the form holds a total of 15. At this point, I don’t think I’ll have more than 15 expiring at a time, so I’m not worried about that yet.
Here’s my query to get the data:
SELECT tblEmployees.[Employee ID#], tblEmployees.LastName, tblEmployees.FirstName, tblEmployees.Status, tblEmployees.Notes, tblEmployeeTasks.Certification, tblTasks.Description, tblEmployeeTasks.[Expiration Date], tblEmployeeTasks.Instruction, tblEmployeeTasks.Method
FROM tblTasks INNER JOIN (tblEvaluators INNER JOIN (tblEvalMethod INNER JOIN (tblEmployees INNER JOIN tblEmployeeTasks ON tblEmployees.[Employee ID#] = tblEmployeeTasks.[Employee ID#]) ON tblEvalMethod.EvalMethod = tblEmployeeTasks.Method) ON tblEvaluators.Evaluator = tblEmployeeTasks.Instruction) ON tblTasks.[Task#] = tblEmployeeTasks.Certification
WHERE (((tblEmployees.[Employee ID#])=[Enter Empl#]));
Here’s a sample of what the above query output is:
Query1
Employee ID# LastName FirstName Status Notes Certification Description Expiration Date Instruction Method
br-245 Jones Sam Active 10533 4/15/2011 John Doe Online
br-245 Jones Sam Active 15049 How to hang crown molding 4/16/2011 John Doe Online
br-245 Jones Sam Active 15940 How to lay a floor 5/1/2011 John Doe Online
Thank you for your help. I have spent the last 3 hours reading posts and trying to find something that would help me with this before posting.
Here’s my query to get the data:
SELECT tblEmployees.[Employee ID#], tblEmployees.LastName, tblEmployees.FirstName, tblEmployees.Status, tblEmployees.Notes, tblEmployeeTasks.Certification, tblTasks.Description, tblEmployeeTasks.[Expiration Date], tblEmployeeTasks.Instruction, tblEmployeeTasks.Method
FROM tblTasks INNER JOIN (tblEvaluators INNER JOIN (tblEvalMethod INNER JOIN (tblEmployees INNER JOIN tblEmployeeTasks ON tblEmployees.[Employee ID#] = tblEmployeeTasks.[Employee ID#]) ON tblEvalMethod.EvalMethod = tblEmployeeTasks.Method) ON tblEvaluators.Evaluator = tblEmployeeTasks.Instruction) ON tblTasks.[Task#] = tblEmployeeTasks.Certification
WHERE (((tblEmployees.[Employee ID#])=[Enter Empl#]));
Here’s a sample of what the above query output is:
Query1
Employee ID# LastName FirstName Status Notes Certification Description Expiration Date Instruction Method
br-245 Jones Sam Active 10533 4/15/2011 John Doe Online
br-245 Jones Sam Active 15049 How to hang crown molding 4/16/2011 John Doe Online
br-245 Jones Sam Active 15940 How to lay a floor 5/1/2011 John Doe Online
Thank you for your help. I have spent the last 3 hours reading posts and trying to find something that would help me with this before posting.