Graydon Armstrong
Graydon Armstrong

Reputation: 13

Counting Rows in a Access Report using letters

I know how to count rows in an Access report using a textbox and Running sum to count rows using numbers.

I am creating a multiple choice text through a report and need to use letters for each of the answers to a question and was wondering how I could label the answer rows using lettes.

ex

a. Choice 1
b. Choice 2
c. Choice 3
<...>

Upvotes: 0

Views: 355

Answers (1)

Gord Thompson
Gord Thompson

Reputation: 123584

Chr(Asc("a") + n - 1) will convert 1 to 'a', 2 to 'b', and so on.

Say you have a "running sum" Text Box named [answerNum] on your report that numbers answers like this:

1  This is the first answer 
2  This is the second answer 
...

You can change the "answer numbering" from numeric (1, 2, ...) to alpha (a, b, ...) by creating another Text Box named [answerLetter] and setting its Control Source to

=Chr(Asc("a") + [answerNum] - 1)

Set [answerNum]'s "Visible" property to False (but don't delete it) and move the [answerLetter] Text Box to the desired location. Your report will now look like this:

a  This is the first answer
b  This is the second answer
...

Upvotes: 1

Related Questions