MaxHeadroom
Technical User
Hi,
I'm putting together an access DB for a confernece I'll be involved in running. I've got a main table containing a list of people, their groups, and their roles. I'm using access XP / 2002 and its an MDB file.
I have a query which selects people who have role ID 1, formats their names properly, and has returns FullName and GroupID. I also have tables defining the Groups and the Roles.
I run a report from this query which produces a very basic list :
[tt]
Committee 1 Name
List of Members
Committee 2 Name
List of Members
etc...[/tt]
I'd like it to have Committee Name - Chairpeople in the header for each committee. The probelm is that chairpeople can have different titles (so different Role_IDs) The roles table looks like this:
[tt]
ID | RoleName | Delegate | Chair | Organiser
autonum | String | yes/no | y/n | y/n[/tt]
I want to be able to execute an SQL query similar to this:
And then process the results so that for each record it returns, create / append a string FirstName Lastname, FirstName Lastname..
Then create a string CommitteeName - Chairsnames and assign it to an unbound control on the report
Me![CommTitle] = namestring.
But I can't figure it out. I've tried using recordsets but can't get it to work properly. I thought I'd got it with a DAO recordset, but you can't use an SQL query as a source for a DAO recordset in a Jet database. I'd really appreciate any help/tips on this.
I'm putting together an access DB for a confernece I'll be involved in running. I've got a main table containing a list of people, their groups, and their roles. I'm using access XP / 2002 and its an MDB file.
I have a query which selects people who have role ID 1, formats their names properly, and has returns FullName and GroupID. I also have tables defining the Groups and the Roles.
I run a report from this query which produces a very basic list :
[tt]
Committee 1 Name
List of Members
Committee 2 Name
List of Members
etc...[/tt]
I'd like it to have Committee Name - Chairpeople in the header for each committee. The probelm is that chairpeople can have different titles (so different Role_IDs) The roles table looks like this:
[tt]
ID | RoleName | Delegate | Chair | Organiser
autonum | String | yes/no | y/n | y/n[/tt]
I want to be able to execute an SQL query similar to this:
Code:
SELECT Participants.FirstName, Participants.Surname, Roles.Chair, Roles.RoleName FROM Roles INNER JOIN Participants ON Roles.ID = Participants.Role WHERE (((Roles.Chair)=True) AND ((Participants.Committee)= '" & Me![Committee] & "'))
And then process the results so that for each record it returns, create / append a string FirstName Lastname, FirstName Lastname..
Then create a string CommitteeName - Chairsnames and assign it to an unbound control on the report
Me![CommTitle] = namestring.
But I can't figure it out. I've tried using recordsets but can't get it to work properly. I thought I'd got it with a DAO recordset, but you can't use an SQL query as a source for a DAO recordset in a Jet database. I'd really appreciate any help/tips on this.