Creating a number

  • Thread starter Thread starter Fay Yocum
  • Start date Start date
F

Fay Yocum

I have an education database. I have created a numbering system that works
as far as I took it. Now I think I need to add a layer of complexity that I
don't know how to make it happen. The current situation create a class
number by combining the ClassID which is number for the name of program.
Added to that is the date of the class and it's start time. So you could see
1-05062004-0715.

Private Sub txtTimeEnd_AfterUpdate()
txtClassNumber = [txtClassID] & "-" & Format([txtDateOfClassStart],
"mmddyy") & "-" & Format([txtTimeStart], "HHMM")
End Sub

It is conceivable that two different instructors would teach the same class
at the same time.

That I think is needed to different multiple classes for the same time and
day. What I want to happen is the following. The first class for that class,
date and time should just be the number 1-05062004-0715, the second class
should be 1-05062004-0715A, the third should be 1-05062004-0715B etc.

This is beyond my current skills. Thanks for your help.
 
Fay said:
I have an education database. I have created a numbering system that
works as far as I took it. Now I think I need to add a layer of
complexity that I don't know how to make it happen. The current
situation create a class number by combining the ClassID which is
number for the name of program. Added to that is the date of the
class and it's start time. So you could see 1-05062004-0715.

Private Sub txtTimeEnd_AfterUpdate()
txtClassNumber = [txtClassID] & "-" & Format([txtDateOfClassStart],
"mmddyy") & "-" & Format([txtTimeStart], "HHMM")
End Sub

It is conceivable that two different instructors would teach the same
class at the same time.

That I think is needed to different multiple classes for the same
time and day. What I want to happen is the following. The first class
for that class, date and time should just be the number
1-05062004-0715, the second class should be 1-05062004-0715A, the
third should be 1-05062004-0715B etc.
This is beyond my current skills. Thanks for your help.

There is no need for and reasons why the Class number field should not be
used.
Just use an autonumber as a key.
You can create it with a calculated field in a query and be sure that it is
always correct.
If I change the time or date in a table or anyplace you forget to update the
field there will be an error.
Following this approach your class number can be constructed by appending
something of value to it, such as the name of the instructor or the room it
will be taught in.
Instead of 1-05062004-0715B it might just be 334456 but you can look it up
by teacher, room number, date, time , department and name
Smith 17a July 24 7:15 AM Math
Math101
looks better on a page and is easier to understand.
 
Back
Top