R
ridders
Hi
I have a report based on a student grades crosstab query with a number of
different cases:
a) Point scores
b) Residual point scores
c) Grades
d) Grades (with Residual scores)
I have successfully used code to apply conditional formatting where the
field values are numbers i.e. a) & b) above
e.g.Set fc = .Add(acFieldValue, acLessThan, 34)
fc.ForeColor = vbBlack
fc.BackColor = vbRed
fc.FontBold = True
I can't get this to work where using grades
e.g. Set fc = .Add(acFieldValue, acLessThan, "C")
fc.ForeColor = vbBlack
fc.BackColor = vbGreen
fc.FontBold = True
I get a enter parameter value box asking me to define "C"
Surely this should be easy. How do I solve this?
Also I want to do something more complex still - see d) above
I want to display grades but format based on residuals!
I have tried displaying both as the crosstab query values
e.g. C -6 where a space is used as a separator
I would then want to display the grade C but use format ting for -6!
Is it possible to do this?
I've tried formatting like this:
Dim FieldValue As Long
FieldValue = Mid(acFieldValue, InStr(1, acFieldValue, " ") +
1)
Debug.Print FieldValue
Set fc = .Add(FieldValue, acLessThan, -6)
fc.ForeColor = vbBlack
fc.BackColor = vbRed
fc.FontBold = True
This doesn't work as the FieldValue always equals 0 for some reason
I also can't see how to modify the cell value after applying formatting
Is it possible to do this at all?
I have a report based on a student grades crosstab query with a number of
different cases:
a) Point scores
b) Residual point scores
c) Grades
d) Grades (with Residual scores)
I have successfully used code to apply conditional formatting where the
field values are numbers i.e. a) & b) above
e.g.Set fc = .Add(acFieldValue, acLessThan, 34)
fc.ForeColor = vbBlack
fc.BackColor = vbRed
fc.FontBold = True
I can't get this to work where using grades
e.g. Set fc = .Add(acFieldValue, acLessThan, "C")
fc.ForeColor = vbBlack
fc.BackColor = vbGreen
fc.FontBold = True
I get a enter parameter value box asking me to define "C"
Surely this should be easy. How do I solve this?
Also I want to do something more complex still - see d) above
I want to display grades but format based on residuals!
I have tried displaying both as the crosstab query values
e.g. C -6 where a space is used as a separator
I would then want to display the grade C but use format ting for -6!
Is it possible to do this?
I've tried formatting like this:
Dim FieldValue As Long
FieldValue = Mid(acFieldValue, InStr(1, acFieldValue, " ") +
1)
Debug.Print FieldValue
Set fc = .Add(FieldValue, acLessThan, -6)
fc.ForeColor = vbBlack
fc.BackColor = vbRed
fc.FontBold = True
This doesn't work as the FieldValue always equals 0 for some reason
I also can't see how to modify the cell value after applying formatting
Is it possible to do this at all?