Autoletter??

CarlyS

Registered User.
Local time
Yesterday, 22:01
Joined
Oct 9, 2004
Messages
115
I have a table of students and their objectives. Each student has multipe objectives, so my data would look like this:

Name--Objective
Name1-Obective1
Name1-Objective2
Name1-Objective3
Name2-Objective1
Name2-Objective2

I would like to generate labels for these objectives like A, B, C, D, which is not a problem, but I want it to start over for each student, like this:

Name--Objective---ObjectiveLabel
Name1-Objective1--"A"
Name1-Objective2--"B"
Name1-Objective3--"C"
Name2-Objective1--"A"
Name2-Objective2--"B"

Is this possible to automate? If not, and my teachers have to enter these labels, any ideas for keeping them from entering a letter twice for the same student?

Thanks in advance!
 
Carly,

You shouldn't have the teacher's assign the labels. They can be calculated.
For instance in a report, you can initialize a control to "1" for each student,
and keep a "running sum". This provides numbering for each objective.

Now instead of 1,2,3,4...

You can use the Chr function (and add something like 64) and it will translate
to A,B,C,D...

Wayne
 
CarlyS said:
Is this possible to automate? If not, and my teachers have to enter these labels, any ideas for keeping them from entering a letter twice for the same student?

Thanks in advance!

Yes, it is possible to Automate.

Have an objective table that is the following:

Objective, ObjectiveLabel

Then on the form, have a combobox with the rowsource:

select objective FROM objectiveTable;

Shrink the text part (white bit) of the combobox to nothing so nobody can type into it, they can just select it.
Place to the right of the objective textbox and change the record source to objective. Make it so that objective locked is Yes and Objective enabled is No.

Then your AfterUpdate for the combobox is the following

Dim checkObjLab

checkObjLab = dlookup("objectiveLabel", "objectivetable", "objective = '" & objective & "'")

The reason why I wouldnt do Waynes suggestion (although he is always correct ;) ) is because you might not want them to be in order. You might want a student with Objective1, 2, and 7. Or you might want more meaningful labels.

To prevent a student having the same letter, there are two ways.

One is to make student, objective AND objective label as the primary keys.
The second is to change the combo rowsource to something like:

SELECT objective FROM objectivetable where objective NOT IN (SELECT objective FROM staff WHERE staffname = '" & staffname & "');

And change the rowsource with the afterUpdate code.
 
WayneRyan said:
Carly,

You shouldn't have the teacher's assign the labels. They can be calculated.
For instance in a report, you can initialize a control to "1" for each student,
and keep a "running sum". This provides numbering for each objective.

Now instead of 1,2,3,4...

You can use the Chr function (and add something like 64) and it will translate
to A,B,C,D...

Wayne


I would like to try this first if at all possible since I am not at all familiar with writing code and this seems fairly simple. I do have one follow-up question, however. I would know how to do this for a report running sum, because I can group by the student name field and use group header/footer. However, I actually want to use the label as data (in an intermediate way). Is it possible to create a running sum using some kind of grouping function on a form so that the label would be created when the objective is entered (or even after a query is run when the form is closed)?

Thanks to you both for your reply and willingness to help. I am hoping to get away with this the easy way because I am more of a special ed teacher than a programmer.
 

Users who are viewing this thread

Back
Top Bottom