If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Set report to show project name instead of its ID
I have a tblProject that contains Projects and its activities.
Since each project has more than one activity, I put the activities in tblActivity, using ProjectID as a foreign key in tblActivity (ProjectID is the primary key in tblProject). I set tblActivity ProjectID field to show project name because it’s easier for me to check if the activities where assigned to the correct project reading the project name instead of its ID. I did this on tblActivity datasheet view, selecting “Lookup” sheet and creating a query on “Rowsource” field (query shows project name instead of its ID). Now I tried to make a report, grouped by project, showing each project name and all its activities. I set the report’s RecordSource to tblActivity. I used the wizard to do the report, adding ProjectID field. But instead of showing project name, it’s showing ProjectID (number). If I was able to set ProjectID field to show project name in tblActivity, why can’t I do the same when I use tblActivity’s ProjectID field in the report? How do I correct this? Thank you very much, Antônio Machado. -- Message posted via http://www.accessmonster.com |
#3
|
|||
|
|||
Set report to show project name instead of its ID
Using Lookup fields in tables is generally consider a bad idea. You should
simply add tblProject to your report's record source. Join the ProjectID fields and make sure you add the project name field in the query output. -- Duane Hookom Microsoft Access MVP "AntonioMachado via AccessMonster.com" wrote: I have a tblProject that contains Projects and its activities. Since each project has more than one activity, I put the activities in tblActivity, using ProjectID as a foreign key in tblActivity (ProjectID is the primary key in tblProject). I set tblActivity ProjectID field to show project name because it’s easier for me to check if the activities where assigned to the correct project reading the project name instead of its ID. I did this on tblActivity datasheet view, selecting “Lookup” sheet and creating a query on “Rowsource” field (query shows project name instead of its ID). Now I tried to make a report, grouped by project, showing each project name and all its activities. I set the report’s RecordSource to tblActivity. I used the wizard to do the report, adding ProjectID field. But instead of showing project name, it’s showing ProjectID (number). If I was able to set ProjectID field to show project name in tblActivity, why can’t I do the same when I use tblActivity’s ProjectID field in the report? How do I correct this? Thank you very much, Antônio Machado. -- Message posted via http://www.accessmonster.com |
#4
|
|||
|
|||
Set report to show project name instead of its ID
AntonioMachado via AccessMonster.com wrote:
I have a tblProject that contains Projects and its activities. Since each project has more than one activity, I put the activities in tblActivity, using ProjectID as a foreign key in tblActivity (ProjectID is the primary key in tblProject). I set tblActivity ProjectID field to show project name because its easier for me to check if the activities where assigned to the correct project reading the project name instead of its ID. I did this on tblActivity datasheet view, selecting Lookup sheet and creating a query on Rowsource field (query shows project name instead of its ID). Now I tried to make a report, grouped by project, showing each project name and all its activities. I set the reports RecordSource to tblActivity. I used the wizard to do the report, adding ProjectID field. But instead of showing project name, its showing ProjectID (number). If I was able to set ProjectID field to show project name in tblActivity, why cant I do the same when I use tblActivitys ProjectID field in the report? You are tying yourself in knots using those bleep lookup fields where what you see is NOT what you get. Change it back to a text box and either learn with the ID number or create a query that Joins the two tables to get the name. You will need that query anyway, because using it as the report's Record Source is the solution to your report problem. -- Marsh MVP [MS Access] |
Thread Tools | |
Display Modes | |
|
|