By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,071 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

Create Code 1/6 for one of six

P: n/a
I am building a calendar to enter and display training courses. I have a
table with the fields CourseID, TrainingDate, TrainingStartTime and
TrainingEndTime. Some courses are one day while others are multiple days.
For all the courses, I want to show on the calendar something like 1/1
indicating class1 of a series of 1 class or 1/6 indicating first class of a
series of 6 classes, 2/6, 3/6, etc for each of the six classes. Would it be
best to include this code in the table or produce it on the fly? If it be
best to include this code in the table, I would prefer to have it entered
automatically when classes are entered in the table. How would that be done?
If on the fly, how would that be done?

Thanks!

Miya
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Two possibilities.

1. Generate the records at runtime.
Just add an extra field to record how many classes are in the course. Then
use a Cartesian Product to print the list with "1 of 6" etc. For details how
how to do that, see:
Printing a Quantity of a Label
at:
http://members.iinet.net.au/~allenbrowne/ser-39.html
2. Store all 6 records.
If you want to store all 6 records, you could use an unbound form where the
user enters the details to be added to your enrollment: CourseID,
TrainingDate, and the number of classes. Then use an Append query statement
to actually add the 6 records to your course. The append query statement
will use the Cartesian Product described above.

To get the query statement, create the form, and mock up a query. Switch to
query to an Append query (Append on Query menu). Once you have the mock up,
switch it to SQL View (View menu), and copy what you see there into the
Click event procedure of the command button on your form. You will end up
with something like this:

Private Sub cmdAdd_Click()
Dim strSql as string
strSQL = "INSERT INTO ... WHERE tblCount.CountID <= " &
Me.NumberOfClasses & ";"
dbEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miya" <mr*******@earthlink.net> wrote in message
news:6j*****************@newsread3.news.atl.earthl ink.net...
I am building a calendar to enter and display training courses. I have a
table with the fields CourseID, TrainingDate, TrainingStartTime and
TrainingEndTime. Some courses are one day while others are multiple days.
For all the courses, I want to show on the calendar something like 1/1
indicating class1 of a series of 1 class or 1/6 indicating first class of
a
series of 6 classes, 2/6, 3/6, etc for each of the six classes. Would it
be
best to include this code in the table or produce it on the fly? If it be
best to include this code in the table, I would prefer to have it entered
automatically when classes are entered in the table. How would that be
done?
If on the fly, how would that be done?

Thanks!

Miya

Nov 13 '05 #2

P: n/a
Allen,

Thank you for responding to my question!

How do I create an unbound form in your #2? The number of classes for any
course will vary from 1 to 15.

I have looked at the link you provided and will be able to use that.

Miya
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Two possibilities.

1. Generate the records at runtime.
Just add an extra field to record how many classes are in the course. Then
use a Cartesian Product to print the list with "1 of 6" etc. For details how how to do that, see:
Printing a Quantity of a Label
at:
http://members.iinet.net.au/~allenbrowne/ser-39.html
2. Store all 6 records.
If you want to store all 6 records, you could use an unbound form where the user enters the details to be added to your enrollment: CourseID,
TrainingDate, and the number of classes. Then use an Append query statement to actually add the 6 records to your course. The append query statement
will use the Cartesian Product described above.

To get the query statement, create the form, and mock up a query. Switch to query to an Append query (Append on Query menu). Once you have the mock up, switch it to SQL View (View menu), and copy what you see there into the
Click event procedure of the command button on your form. You will end up
with something like this:

Private Sub cmdAdd_Click()
Dim strSql as string
strSQL = "INSERT INTO ... WHERE tblCount.CountID <= " &
Me.NumberOfClasses & ";"
dbEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miya" <mr*******@earthlink.net> wrote in message
news:6j*****************@newsread3.news.atl.earthl ink.net...
I am building a calendar to enter and display training courses. I have a
table with the fields CourseID, TrainingDate, TrainingStartTime and
TrainingEndTime. Some courses are one day while others are multiple days. For all the courses, I want to show on the calendar something like 1/1
indicating class1 of a series of 1 class or 1/6 indicating first class of a
series of 6 classes, 2/6, 3/6, etc for each of the six classes. Would it
be
best to include this code in the table or produce it on the fly? If it be best to include this code in the table, I would prefer to have it entered automatically when classes are entered in the table. How would that be
done?
If on the fly, how would that be done?

Thanks!

Miya


Nov 13 '05 #3

P: n/a
An unbound form is just a form that has text boxes where the user enters the
values. The form is not tied to any table. You execute the INSERT query
statement to write multiple records to the table.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miya" <mr*******@earthlink.net> wrote in message
news:VM*****************@newsread3.news.atl.earthl ink.net...
Allen,

Thank you for responding to my question!

How do I create an unbound form in your #2? The number of classes for any
course will vary from 1 to 15.

I have looked at the link you provided and will be able to use that.

Miya
"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Two possibilities.

1. Generate the records at runtime.
Just add an extra field to record how many classes are in the course.
Then
use a Cartesian Product to print the list with "1 of 6" etc. For details

how
how to do that, see:
Printing a Quantity of a Label
at:
http://members.iinet.net.au/~allenbrowne/ser-39.html
2. Store all 6 records.
If you want to store all 6 records, you could use an unbound form where

the
user enters the details to be added to your enrollment: CourseID,
TrainingDate, and the number of classes. Then use an Append query

statement
to actually add the 6 records to your course. The append query statement
will use the Cartesian Product described above.

To get the query statement, create the form, and mock up a query. Switch

to
query to an Append query (Append on Query menu). Once you have the mock

up,
switch it to SQL View (View menu), and copy what you see there into the
Click event procedure of the command button on your form. You will end up
with something like this:

Private Sub cmdAdd_Click()
Dim strSql as string
strSQL = "INSERT INTO ... WHERE tblCount.CountID <= " &
Me.NumberOfClasses & ";"
dbEngine(0)(0).Execute strSQL, dbFailOnError
End Sub

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Miya" <mr*******@earthlink.net> wrote in message
news:6j*****************@newsread3.news.atl.earthl ink.net...
>I am building a calendar to enter and display training courses. I have a
> table with the fields CourseID, TrainingDate, TrainingStartTime and
> TrainingEndTime. Some courses are one day while others are multiple days. > For all the courses, I want to show on the calendar something like 1/1
> indicating class1 of a series of 1 class or 1/6 indicating first class of > a
> series of 6 classes, 2/6, 3/6, etc for each of the six classes. Would
> it
> be
> best to include this code in the table or produce it on the fly? If it be > best to include this code in the table, I would prefer to have it entered > automatically when classes are entered in the table. How would that be
> done?
> If on the fly, how would that be done?
>
> Thanks!
>
> Miya



Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.