Connecting Tech Pros Worldwide Forums | Help | Site Map

conditional format wtih crosstab query

Paul T. Rong
Guest
 
Posts: n/a
#1: Nov 13 '05
I don't know why that I lost track of the post. I found it from the
newsgroup and paste last two posts.
Pieter Linden said:
"To do this - use conditional formatting..."

I didn' work it out. Seems to complicated. Can anyone help with this
conditional formatting?
Thanks
Paul

----------------------------------------------------------------------------
---------------------------------------------
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
回应留言

线索内的第 15 条留言
寄件者:Pieter Linden (pietlinden@hotmail.com)
主旨:Re: How to show the contents of a field (50 items) in a form not
in vertical way but 5 rows 10 columns?


View this article only
网上论坛:comp.databases.ms-access
日期:2004-10-11 14:15:41 PST

[color=blue]
> now I need help to make this possible:
>
> note that there is a field "Absence" in table "tblStudent". How to make[/color]
the[color=blue]
> txtbox back color in red in form frmStudent? For example, Eva is absent,[/color]
so[color=blue]
> the text box with her name is in red color.
>
> Thanks,
>
> Paul[/color]

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.




Closed Thread