473,396 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to show the contents of a field (50 items) in a form not in vertical way but 5 rows 10 columns?

Hi everybody,

This time a very very difficult case:

I have a table "tblStudent", there are 50 students, I also made a form
"frmStudent" based on "tblStudent", now if I don't want to show all the
students in a classical (vertically, from top to bottom) way, but make them
"sitting" in 50 text boxes, 5 rows 10 columns, how to do it?

Thanks in advance.

I myself tried many times, didn't find a solution, thinking maybe it is just
not realistic under Access.

Paul
Nov 13 '05 #1
15 2263
What do you mean about a classical way? Viewing them vertically means that
you've designed a continuous form where each record is underneath each
other.

There are 3 types of forms: Single form, Continuous and Datasheet. Single
forms display only one record at a time and are good for showing lots of
fields at a time. Datasheet forms look like tables and are mainly used for
sub-forms but can be used as a normal form for data entry. Continuous forms
behave the same way as datasheet forms and display many records per page but
you have the advantage of moving the fields about into multiple rows per
record e.g. a row with 16 fields may not fit across the screen so you move
the last 8 fields under the first, close the height of the detail section
and in view mode the continuous form will have 2 rows per record.

What I think you mean about displaying all the students in 50 text boxes is
the name of student 1 in the first box, the name of student 2 in the second
on so on. This could be done with code but what if you get 65 students,
you'll have to add more text boxes, What if you get 120 students, the screen
will get a bit full. Doing it this way will mean that you will not be able
to edit any names.

Please explain in a bit more detail about what you're trying to do and maybe
also why you want to do it that way. Someone may come up with a better
solution.

Jeff
"Paul T. Rong" <et***@hotmail.com> wrote in message
news:S6********************@news.chello.at...
Hi everybody,

This time a very very difficult case:

I have a table "tblStudent", there are 50 students, I also made a form
"frmStudent" based on "tblStudent", now if I don't want to show all the
students in a classical (vertically, from top to bottom) way, but make them "sitting" in 50 text boxes, 5 rows 10 columns, how to do it?

Thanks in advance.

I myself tried many times, didn't find a solution, thinking maybe it is just not realistic under Access.

Paul

Nov 13 '05 #2
"Paul T. Rong" <et***@hotmail.com> wrote in message
news:S6********************@news.chello.at...
Hi everybody,

This time a very very difficult case:

I have a table "tblStudent", there are 50 students, I also made a form
"frmStudent" based on "tblStudent", now if I don't want to show all the
students in a classical (vertically, from top to bottom) way, but make them "sitting" in 50 text boxes, 5 rows 10 columns, how to do it?

Thanks in advance.

I myself tried many times, didn't find a solution, thinking maybe it is just not realistic under Access.

Paul

It's not that difficult - providing you are happy to use an unbound form.
This is quite an unusual requirement for a form although it wouldn't be so
weird with a report designed for display only. What purpose should this
form have? Read-only, edits, additions, deletions?


Nov 13 '05 #3
On Thu, 07 Oct 2004 10:45:06 GMT, "Paul T. Rong" <et***@hotmail.com>
wrote:
Hi everybody,

This time a very very difficult case:

I have a table "tblStudent", there are 50 students, I also made a form
"frmStudent" based on "tblStudent", now if I don't want to show all the
students in a classical (vertically, from top to bottom) way, but make them
"sitting" in 50 text boxes, 5 rows 10 columns, how to do it?

Thanks in advance.

I myself tried many times, didn't find a solution, thinking maybe it is just
not realistic under Access.

Paul

Hi
You can do this with five subforms and queries to show the right items
in each, requerying when items are added and deleted. Scrolling needs
careful thought if there are more records than show.
Or you could write everthing into a temporary table with the right
shape and write things back afterwards.This is easier if you want the
records in order
1 2 3 4 5
6 7 8 9 10
etc
Or you use Excel automation, but I wouldn't!

In a report you can use columns of course.
David


Nov 13 '05 #4
For example, there are 15 students in a certain class (there are many
classes in a school but max. there are 50 students in a class).

The tblStudent may look like this:

StudentID StudentName Row Column
1 Eva 1 1
2 Tomas 1 2
3 Barbara 1 3
....
8 Johana 2 3
.....
15 Ludo 3 5
I would like the "frmStudent" look like what the students sit (their
position) in the classroom, that is

Eva Tomas Barbara Ivan Marek
Veronika Jan Johana Elena Pavel
Alex Julia Natalia Theresa Ludo

-----------------------------------------------------------

I would like to use text box or other controls to represent every student so
that when I click on each of their names and a form can be opened with the
clicked student name on it.

This form is called "frmExam", is based on a table "tblExam".

tblExam includes following fields:

ExamID (autonumber) PK
StudentID FK
ExamDate

"frmExam" has a subform "sbfrmExam" which is based on a table
"tblExam_detail".

tblExam_detail includes follwoing fields:

ExamID PK
subjectID PK
marks

tblExam_detail is connected with tblSubject which has two field: "SubjectID"
and "Subject"

I would like to see the average mark from all subjects can be shown later
under each of the students names.

above is just my plan, I was stopped at the first step at the "frmStudent".

I am not sure if I should choose a unbound form, and use code (I prefer not
with lots of codes).

I try to figure out David's idea with "subforms and queries".

Thank you for your patience, I hope I made myself understood.

Paul

from
Bratislava
Slovakia


"Paul T. Rong" <et***@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ
:S6********************@news.chello.at...
Hi everybody,

This time a very very difficult case:

I have a table "tblStudent", there are 50 students, I also made a form
"frmStudent" based on "tblStudent", now if I don't want to show all the
students in a classical (vertically, from top to bottom) way, but make them "sitting" in 50 text boxes, 5 rows 10 columns, how to do it?

Thanks in advance.

I myself tried many times, didn't find a solution, thinking maybe it is just not realistic under Access.

Paul

Nov 13 '05 #5
Create a two-dimensional array from your data and pass it to Excel and
be done with it. Then you can just do something like

Cell(iRow+iRowOffset,iColumn+iColumnOffset)=Array( iRow,iColumn)
Nov 13 '05 #6
Doing this in VB is one thing, doing it in Access VBA is quite
another. In VB, you can have control arrays and then reference the
subscripts, so you could have a two-dimensional array of textboxes,
something like

Dim Student(4,4) as String
which could hold 25 values. then you could loop through the array...

Dim intRow as integer
Dim intColumn as Integer

for intRow=0 to 4
for intColumn=0 to 4
me.lblSeat(intRow,intColumn).Caption = rs!StudentName
rs.MoveNext
next intColumn
Next intRow

....

But there are NO control arrays in Access VBA. Key difference.
Nov 13 '05 #7
First create a query to order the students by rows then columns. Name it
qryStudentsSorted
**qryStudentsSorted**
SELECT StudentID, StudentName, YourRow, YourColumn
FROM tblStudents
ORDER BY YourRow, YourColumn;

With your form add your 50 text boxes with names of txt1, txt2, txt3 etc
with text boxes txt1 to txt5 on the top and the next row txt6 to txt10 and
so on.

Paste the following code behind the form:
' ***Code Start***
Option Compare Database
Option Explicit

' Constant for the maximum number of
' text boxes on the form.
Const txtMax As Byte = 42

Private Sub Form_Load()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim intI As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("qryStudentsSorted")
' Call the routine to clear all fields
' before loading the data.
ClearFields
' Add the StudentName to each text box.
With rst
.MoveFirst
Do Until .EOF Or intI = txtMax
intI = intI + 1
Me("txt" & intI) = !StudentName
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub

Private Sub ClearFields()
Dim intI As Integer
For intI = 1 To txtMax
Me("txt" & intI) = Null
Next
End Sub
' *** Code End***

This will display all your students into every text box on your form.

To open up another form to by double clicking the student's name you'll have
to add 50 more text boxes, set their visible properties to No, name them the
same way as above but use something different than "txt" (in the code below
I used "i") and place them on top of the corresponding text box name. e.g.
txt1 and i1, txt2 and i2. Note: Make the size of these text boxes smaller
and have a different back colour so it makes it easier when in design view.

In the above code add the following line of code above the .MoveNext line:
Me("i" & intI) = !StudentID

Paste the following code below into your form:
' ***Code Start***
Private Sub OpenExam(strFieldName As String)
Dim intI As Integer
Dim intLen As Integer
Dim strTemp As String
' Remove the "txt" and prefix the remainder
' with an "i".
intLen = Len(strFieldName)
intI = CInt(Mid(strFieldName, 4, intLen - 3))
strTemp = "i" & intI
' Open the form.
DoCmd.OpenForm "frmExam", , , "[StudentID]=" & Me(strTemp) & " And
[ExamID]=" & ExamID
End Sub
' ***Code End***

In the Double Click event of every text box call the above sub routine using
the text box control's name e.g. using txt42
Private Sub txt42_DblClick(Cancel As Integer)
' Call the OpenExam sub
OpenExam Me!txt42.Name
End Sub

WARNING: No error trapping here. That's up to you.
Questions: How do you know which exam you want to open when you click on a
student? What if that student sits more than one exam? Do you want to open
up a different form which displays the student with a sub-form that show all
the exams that that student has sat?

With your table structure I'll go this way:
tbl_Exams
ExamID PK (Autonumber)
SubjectID FK
ExamDate

tbl_ExamStudents
ExamID PK (Long)
StudentID PK (Long)
Marks

This way you create a date for the exam and set the exam's subject. The
tbl_ExamStudents then stores all the students that sat (or would sit) that
exam. This would be a sub-form on the exam form.

Hope all this helps
Jeff

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:jZ*********************@news.chello.at...
For example, there are 15 students in a certain class (there are many
classes in a school but max. there are 50 students in a class).

The tblStudent may look like this:

StudentID StudentName Row Column
1 Eva 1 1
2 Tomas 1 2
3 Barbara 1 3
...
8 Johana 2 3
....
15 Ludo 3 5
I would like the "frmStudent" look like what the students sit (their
position) in the classroom, that is

Eva Tomas Barbara Ivan Marek
Veronika Jan Johana Elena Pavel
Alex Julia Natalia Theresa Ludo

-----------------------------------------------------------

I would like to use text box or other controls to represent every student so that when I click on each of their names and a form can be opened with the
clicked student name on it.

This form is called "frmExam", is based on a table "tblExam".

tblExam includes following fields:

ExamID (autonumber) PK
StudentID FK
ExamDate

"frmExam" has a subform "sbfrmExam" which is based on a table
"tblExam_detail".

tblExam_detail includes follwoing fields:

ExamID PK
subjectID PK
marks

tblExam_detail is connected with tblSubject which has two field: "SubjectID" and "Subject"

I would like to see the average mark from all subjects can be shown later
under each of the students names.

above is just my plan, I was stopped at the first step at the "frmStudent".
I am not sure if I should choose a unbound form, and use code (I prefer not with lots of codes).

I try to figure out David's idea with "subforms and queries".

Thank you for your patience, I hope I made myself understood.

Paul

from
Bratislava
Slovakia

Nov 13 '05 #8
Hi Jeff,

I never expected such a great reply to my post. That is a big help. I was
touched. Thank you very much.

Because my knowledge on vba is very poor, it will take some time till I
fully understand the meaning of the codes. That will be a very good lesson
for me and also for other beginners on this newsgroup to get close to vba.
Questions: How do you know which exam you want to open when you click on a
student? What if that student sits more than one exam?
Sorry, I don't know.
Do you want to open
up a different form which displays the student with a sub-form that show all the exams that that student has sat?
Yes, that is what I want. But in this way, I have to repair my tables

tblExamInfo (better than tblExam)

ExamInfoID (autonumber) PK
StudentID FK

tblExam_detail

ExamInfoID PK
subjectID PK
marks
ExamDate
greetings from Bratislava

Paul
"Jeff Smith" <No***@Not.This.Address> дÈëÏûÏ¢ÐÂÎÅ
:ck**********@lust.ihug.co.nz... First create a query to order the students by rows then columns. Name it
qryStudentsSorted
**qryStudentsSorted**
SELECT StudentID, StudentName, YourRow, YourColumn
FROM tblStudents
ORDER BY YourRow, YourColumn;

With your form add your 50 text boxes with names of txt1, txt2, txt3 etc
with text boxes txt1 to txt5 on the top and the next row txt6 to txt10 and
so on.

Paste the following code behind the form:
' ***Code Start***
Option Compare Database
Option Explicit

' Constant for the maximum number of
' text boxes on the form.
Const txtMax As Byte = 42

Private Sub Form_Load()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim intI As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("qryStudentsSorted")
' Call the routine to clear all fields
' before loading the data.
ClearFields
' Add the StudentName to each text box.
With rst
.MoveFirst
Do Until .EOF Or intI = txtMax
intI = intI + 1
Me("txt" & intI) = !StudentName
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub

Private Sub ClearFields()
Dim intI As Integer
For intI = 1 To txtMax
Me("txt" & intI) = Null
Next
End Sub
' *** Code End***

This will display all your students into every text box on your form.

To open up another form to by double clicking the student's name you'll have to add 50 more text boxes, set their visible properties to No, name them the same way as above but use something different than "txt" (in the code below I used "i") and place them on top of the corresponding text box name. e.g.
txt1 and i1, txt2 and i2. Note: Make the size of these text boxes smaller
and have a different back colour so it makes it easier when in design view.
In the above code add the following line of code above the .MoveNext line:
Me("i" & intI) = !StudentID

Paste the following code below into your form:
' ***Code Start***
Private Sub OpenExam(strFieldName As String)
Dim intI As Integer
Dim intLen As Integer
Dim strTemp As String
' Remove the "txt" and prefix the remainder
' with an "i".
intLen = Len(strFieldName)
intI = CInt(Mid(strFieldName, 4, intLen - 3))
strTemp = "i" & intI
' Open the form.
DoCmd.OpenForm "frmExam", , , "[StudentID]=" & Me(strTemp) & " And
[ExamID]=" & ExamID
End Sub
' ***Code End***

In the Double Click event of every text box call the above sub routine using the text box control's name e.g. using txt42
Private Sub txt42_DblClick(Cancel As Integer)
' Call the OpenExam sub
OpenExam Me!txt42.Name
End Sub

WARNING: No error trapping here. That's up to you.
Questions: How do you know which exam you want to open when you click on a
student? What if that student sits more than one exam? Do you want to open
up a different form which displays the student with a sub-form that show all the exams that that student has sat?

With your table structure I'll go this way:
tbl_Exams
ExamID PK (Autonumber)
SubjectID FK
ExamDate

tbl_ExamStudents
ExamID PK (Long)
StudentID PK (Long)
Marks

This way you create a date for the exam and set the exam's subject. The
tbl_ExamStudents then stores all the students that sat (or would sit) that
exam. This would be a sub-form on the exam form.

Hope all this helps
Jeff

"Paul T. Rong" <et***@hotmail.com> wrote in message
news:jZ*********************@news.chello.at...
For example, there are 15 students in a certain class (there are many
classes in a school but max. there are 50 students in a class).

The tblStudent may look like this:

StudentID StudentName Row Column
1 Eva 1 1
2 Tomas 1 2
3 Barbara 1 3
...
8 Johana 2 3
....
15 Ludo 3 5
I would like the "frmStudent" look like what the students sit (their
position) in the classroom, that is

Eva Tomas Barbara Ivan Marek
Veronika Jan Johana Elena Pavel
Alex Julia Natalia Theresa Ludo

-----------------------------------------------------------

I would like to use text box or other controls to represent every student
so
that when I click on each of their names and a form can be opened with

the clicked student name on it.

This form is called "frmExam", is based on a table "tblExam".

tblExam includes following fields:

ExamID (autonumber) PK
StudentID FK
ExamDate

"frmExam" has a subform "sbfrmExam" which is based on a table
"tblExam_detail".

tblExam_detail includes follwoing fields:

ExamID PK
subjectID PK
marks

tblExam_detail is connected with tblSubject which has two field:

"SubjectID"
and "Subject"

I would like to see the average mark from all subjects can be shown later under each of the students names.

above is just my plan, I was stopped at the first step at the

"frmStudent".

I am not sure if I should choose a unbound form, and use code (I prefer

not
with lots of codes).

I try to figure out David's idea with "subforms and queries".

Thank you for your patience, I hope I made myself understood.

Paul

from
Bratislava
Slovakia


Nov 13 '05 #9
> > Questions: How do you know which exam you want to open when you click on a
student? What if that student sits more than one exam?


Sorry, I don't know.
Do you want to open
up a different form which displays the student with a sub-form that show

all
the exams that that student has sat?


Yes, that is what I want. But in this way, I have to repair my tables


You'd be better off figuring out EXACTLY what this database has to do
BEFORE you build, or you're going to be repairing more than just a few
tables. But don't take my word for it - have a read through the
introduction to the
Access Developer Handbook. Otherwise, heaven help to poor person that
inherits your stuff. Normalize ON PAPER and then when you have an
acceptable normalized design, start building your database. Don't
know about you, but I would no sooner build a critical database
without doing all the initial "spadework" than I would build a house
without having a foundation poured.
Nov 13 '05 #10
You are right. Thanks.

Paul
"Pieter Linden" <pi********@hotmail.com>
??????:bf**************************@posting.google .com...
Questions: How do you know which exam you want to open when you click on a student? What if that student sits more than one exam?


Sorry, I don't know.
Do you want to open
up a different form which displays the student with a sub-form that
show all
the exams that that student has sat?


Yes, that is what I want. But in this way, I have to repair my tables


You'd be better off figuring out EXACTLY what this database has to do
BEFORE you build, or you're going to be repairing more than just a few
tables. But don't take my word for it - have a read through the
introduction to the
Access Developer Handbook. Otherwise, heaven help to poor person that
inherits your stuff. Normalize ON PAPER and then when you have an
acceptable normalized design, start building your database. Don't
know about you, but I would no sooner build a critical database
without doing all the initial "spadework" than I would build a house
without having a foundation poured.

Nov 13 '05 #11

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
Questions: How do you know which exam you want to open when you click on a student? What if that student sits more than one exam?


Sorry, I don't know.
Do you want to open
up a different form which displays the student with a sub-form that
show all
the exams that that student has sat?


Yes, that is what I want. But in this way, I have to repair my tables


You'd be better off figuring out EXACTLY what this database has to do
BEFORE you build, or you're going to be repairing more than just a few
tables. But don't take my word for it - have a read through the
introduction to the
Access Developer Handbook. Otherwise, heaven help to poor person that
inherits your stuff. Normalize ON PAPER and then when you have an
acceptable normalized design, start building your database. Don't
know about you, but I would no sooner build a critical database
without doing all the initial "spadework" than I would build a house
without having a foundation poured.


I agree with Pieter here, you have to know exactly what the database has to
do before you even start. The code I posted the other day shows you what can
be done with VBA. The questions I asked were there to make you think about
the database's design and also the same with the table structure I gave you.

My table structure was:
***tbl_Exams***
ExamID PK (Autonumber)
SubjectID FK
ExamDate

***tbl_ExamStudents***
ExamID PK (Long)
StudentID PK (Long)
Marks

With this structure, many students can sit the one exam.
The tbl_Exams is the exam paper itself with its unique ID, the subject
(topic) of the exam and its date. e.g. ID:3, Subject:World War 2 History,
ExamDate:14 Nov 2003
The tbl_ExamStudents links all the students that sit that exam and also the
marks they get.
When also linked to the tbl_Students table you will get a many to many
relationship; each student can sit many exams and each exam can have many
students. If a student has to re-sit an exam, you create a new exam with a
new date and link the student to the new exam. e.g. ID:5, Subject:World War
2 History, ExamDate:30 Nov 2003

Here's a link that will help you
http://www.databaseanswers.org/data_...xams/index.htm
The site's main index is
http://www.databaseanswers.org/data_models/index.htm

This is all to help you think about your design and help you become a good
developer.
Jeff
Nov 13 '05 #12
Thank you.

I didn't build anything yet. It takes some time for me to digest all the
materials I got before I set up to build. Your comments helped me a lot.
May I ask you one question concerning your code?
------------------------
your code:

Private Sub Form_Load()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim intI As Integer
Set db = CurrentDb
Set rst = db.OpenRecordset("qryStudentsSorted")
' Call the routine to clear all fields
' before loading the data.
ClearFields
' Add the StudentName to each text box.
With rst
.MoveFirst
Do Until .EOF Or intI = txtMax
intI = intI + 1
Me("txt" & intI) = !StudentName
.MoveNext
Loop
End With
rst.Close
Set rst = Nothing
Set db = Nothing
End Sub

-----------------------------------------------

Can you tell me what do they do these three lines at the end of the code:
"
rst.Close
Set rst = Nothing
Set db = Nothing
"
and why need to clear all fields before loading the data?

Thanks,

Paul



"Jeff Smith" <No***@Not.This.Address> дÈëÏûÏ¢ÐÂÎÅ
:ck**********@lust.ihug.co.nz...

"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
> Questions: How do you know which exam you want to open when you
click
on a > student? What if that student sits more than one exam?

Sorry, I don't know.

> Do you want to open
> up a different form which displays the student with a sub-form that show all
> the exams that that student has sat?

Yes, that is what I want. But in this way, I have to repair my
tables
You'd be better off figuring out EXACTLY what this database has to do
BEFORE you build, or you're going to be repairing more than just a few
tables. But don't take my word for it - have a read through the
introduction to the
Access Developer Handbook. Otherwise, heaven help to poor person that
inherits your stuff. Normalize ON PAPER and then when you have an
acceptable normalized design, start building your database. Don't
know about you, but I would no sooner build a critical database
without doing all the initial "spadework" than I would build a house
without having a foundation poured.
I agree with Pieter here, you have to know exactly what the database has

to do before you even start. The code I posted the other day shows you what can be done with VBA. The questions I asked were there to make you think about
the database's design and also the same with the table structure I gave you.
My table structure was:
***tbl_Exams***
ExamID PK (Autonumber)
SubjectID FK
ExamDate

***tbl_ExamStudents***
ExamID PK (Long)
StudentID PK (Long)
Marks

With this structure, many students can sit the one exam.
The tbl_Exams is the exam paper itself with its unique ID, the subject
(topic) of the exam and its date. e.g. ID:3, Subject:World War 2 History,
ExamDate:14 Nov 2003
The tbl_ExamStudents links all the students that sit that exam and also the marks they get.
When also linked to the tbl_Students table you will get a many to many
relationship; each student can sit many exams and each exam can have many
students. If a student has to re-sit an exam, you create a new exam with a
new date and link the student to the new exam. e.g. ID:5, Subject:World War 2 History, ExamDate:30 Nov 2003

Here's a link that will help you
http://www.databaseanswers.org/data_...xams/index.htm
The site's main index is
http://www.databaseanswers.org/data_models/index.htm

This is all to help you think about your design and help you become a good
developer.
Jeff

Nov 13 '05 #13
This is just one alternative:

The table "tblStudent":

StudentID StudentName Row Column Absence
1 Eva 1 1 Yes
2 Tomas 1 2 No
3 Barbara 1 3 No
....
8 Johana 2 3 No
.....
15 Ludo 3 5 Yes
make a cross query naming it "qryStudent" with [tblStudent]!Row as Row,
[tblStudent]!Column as Column, [tblStudent]!StudentName as Value (last),
then it is very easy to get something like:

Row 1 2 3 4 5
1 Eva Tomas Barbara Ivan Marek
2 Veronika Jan Johana Elena Pavel
3 Alex Julia Natalia Theresa Ludo
make a form frmStudent based on "qryStudent", and you can show the above
infomation beautifully in a form, without any code.

now I need help to make this possible:

note that there is a field "Absence" in table "tblStudent". How to make the
txtbox back color in red in form frmStudent? For example, Eva is absent, so
the text box with her name is in red color.

Thanks,

Paul




Nov 13 '05 #14
> now I need help to make this possible:

note that there is a field "Absence" in table "tblStudent". How to make the
txtbox back color in red in form frmStudent? For example, Eva is absent, so
the text box with her name is in red color.

Thanks,

Paul


To do this - use conditional formatting...

Also, this model of attendance is odd. It should be something like:

CREATE TABLE Student(
StudentID INTEGER PRIMARY KEY,
FirstName TEXT(25) NOT NULL,
LastName TEXT(25) NOT NULL,
....);

CREATE TABLE Attendance(
StudentID INTEGER,
SchoolDate DATE,
Attended BOOLEAN,
PRIMARY KEY (StudentID, SchoolDate));

If you do not put the attendance records in a separate table, you'll
lose the history of when a student was absent. You'll have only one
record instead of one per student per day.
Nov 13 '05 #15
Pieter,
To do this - use conditional formatting...

can you help to give an example?

Paul
"Pieter Linden" <pi********@hotmail.com>
??????:bf**************************@posting.google .com...
now I need help to make this possible:

note that there is a field "Absence" in table "tblStudent". How to make the txtbox back color in red in form frmStudent? For example, Eva is absent, so the text box with her name is in red color.

Thanks,

Paul


To do this - use conditional formatting...

Also, this model of attendance is odd. It should be something like:

CREATE TABLE Student(
StudentID INTEGER PRIMARY KEY,
FirstName TEXT(25) NOT NULL,
LastName TEXT(25) NOT NULL,
...);

CREATE TABLE Attendance(
StudentID INTEGER,
SchoolDate DATE,
Attended BOOLEAN,
PRIMARY KEY (StudentID, SchoolDate));

If you do not put the attendance records in a separate table, you'll
lose the history of when a student was absent. You'll have only one
record instead of one per student per day.

Nov 13 '05 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: ioneabu | last post by:
The below function attempts to remove the contents of one form and replace with the contents of another. Is this not possible? Why not? It will make a big difference in the final solution to a...
4
by: Apple | last post by:
Can I edit an calculated field in my form if needed. Thank you in advance for your help. Sincerely Apple
1
by: ad | last post by:
I want to show two field in a column of Gridview. I use the code : But it only show Bind("InjectDate") How can I show two field at once in a Template? <ItemTemplate> <asp:Label...
10
reginaldmerritt
by: reginaldmerritt | last post by:
i wish to change the backcolor of a field on a current record being dispalyed in a 'multiple items' form. However when using me.fieldname01.backcolor = makes refrence to all fields called fieldname01...
1
by: sudhashekhar30 | last post by:
hi all how can i show starting 10 items out of 20 itmes in dropdownlist server control. remaining items will be shown, when list will be scrolled down, again only 10 at a time.
1
by: nithingujjar | last post by:
Hi, I need to to hide a field"addr_state1" based on a value in the drop down list field called "addr_country".i.e.,if addr_country.value=="in" then hide addr_state1 else , and if the value in the...
0
by: chromis | last post by:
Hi, How do i go about adding vertical padding to a dynamic text field with a vertical UIScrollbar? Thanks, Chromis
6
by: viki1967 | last post by:
Hi all. I need your help. I realize this script and I do not know where to begin: 1) A simple grid rows / columns. 2) The first column contain an input type = "checkbox" 3) When select...
3
by: ronakinuk | last post by:
how can i unhide rows/columns in excel 2007
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.