I'm *hoping* that someone can help me with a problem that I'm having trying to create a report format in Access XP. (I'm a "basic" Access user who has a small amount of experience, but am delving into new waters here.)
What I'm trying to do is print a report of our department's AV inventory titles, where each title in the Access table contains a field with a code designating which course level in our progam is the primary user of that title. On the report, I've set it to group the titles by course level, and I would like to have a text box in the header for each section (group) that identifies the name of the primary course, based on the contents of the field designating the primary course, which is called NSG_LEVEL.
I've pored into the depths of the Access help files, and found information on using both the IIf function and the If-Then-Else statements. Based on my needs, the If-Then-Else statements seems to be what I need, in order to specify the contents of the text box label, depending on the contents of the NSG_LEVEL field. But, my attempts so far have failed. (The IIf function I've experimented with seems to work, but the function doesn't seem to be able to handle enough possibilities to suit my needs, being an either-or type of thing.) I put together an If-Then-Else statement that follows the example in the help file, and the first version generated a syntax error message when attempting to generate the report, and the latest version seems to be ignored by Access (no syntax error message), which simply displays the contents of the NSG_LEVEL field in the text box, instead of the text label desired.
In case anyone can point me in the right direction, below is the current version of the If-Then-Else statement that I've typed into the control source area of the properties dialog of the text box, named Text48:
= IF NSG_LEVEL = "N1R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING I"
ELSEIF NSG_LEVEL = "N2R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING II"
ELSEIF NSG_LEVEL = "N3R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING III"
ELSEIF NSG_LEVEL = "N4R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING IV"
ELSEIF NSG_LEVEL = "N5R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING V"
ELSEIF NSG_LEVEL = "NUR" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NUTRITION"
ELSE
REPORTS![AV Titles in Course Manuals]![Text48] = "PHARMACOLOGY"
END IF
I'm new to this stuff, and I'm hoping there is something that I'm missing that, if added to this, will help produce the results I'm after. I've just about exhausted everything that I can make sense of in the Access help file, so if anyone can help, you will have my undying gratitude!
What I'm trying to do is print a report of our department's AV inventory titles, where each title in the Access table contains a field with a code designating which course level in our progam is the primary user of that title. On the report, I've set it to group the titles by course level, and I would like to have a text box in the header for each section (group) that identifies the name of the primary course, based on the contents of the field designating the primary course, which is called NSG_LEVEL.
I've pored into the depths of the Access help files, and found information on using both the IIf function and the If-Then-Else statements. Based on my needs, the If-Then-Else statements seems to be what I need, in order to specify the contents of the text box label, depending on the contents of the NSG_LEVEL field. But, my attempts so far have failed. (The IIf function I've experimented with seems to work, but the function doesn't seem to be able to handle enough possibilities to suit my needs, being an either-or type of thing.) I put together an If-Then-Else statement that follows the example in the help file, and the first version generated a syntax error message when attempting to generate the report, and the latest version seems to be ignored by Access (no syntax error message), which simply displays the contents of the NSG_LEVEL field in the text box, instead of the text label desired.
In case anyone can point me in the right direction, below is the current version of the If-Then-Else statement that I've typed into the control source area of the properties dialog of the text box, named Text48:
= IF NSG_LEVEL = "N1R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING I"
ELSEIF NSG_LEVEL = "N2R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING II"
ELSEIF NSG_LEVEL = "N3R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING III"
ELSEIF NSG_LEVEL = "N4R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING IV"
ELSEIF NSG_LEVEL = "N5R" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NURSING V"
ELSEIF NSG_LEVEL = "NUR" THEN
REPORTS![AV Titles in Course Manuals]![Text48] = "NUTRITION"
ELSE
REPORTS![AV Titles in Course Manuals]![Text48] = "PHARMACOLOGY"
END IF
I'm new to this stuff, and I'm hoping there is something that I'm missing that, if added to this, will help produce the results I'm after. I've just about exhausted everything that I can make sense of in the Access help file, so if anyone can help, you will have my undying gratitude!