Hi,
I have a tabular form that is working fine. It has a field called "Gender". The values are M for Male, F for Female and E for Exam.
I want to display M in blue, F in Red and E in black.
I used the following code:
Dim lngRed As Long, lngBlue As Long, lngBlack As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngBlue = RGB(0, 0, 255)
If Me.Gender = M Then
Me.Gender.ForeColor = IngBlue
ElseIf Me.Gender = F Then
Me.Gender.ForeColor = IngRed
Else
Me.Gender.ForeColor = IngBlack
End If
The problem:
- The color does not change
- I get no error from the code
-I also tried putting the gender value between quotation marks, but nothing happened.
- I tried the code once in On Current event and once in On Open event, but nothing happened.
Is the code correct or Tabular forms can't be controled in this way?
Best regards
Paulin
I have a tabular form that is working fine. It has a field called "Gender". The values are M for Male, F for Female and E for Exam.
I want to display M in blue, F in Red and E in black.
I used the following code:
Dim lngRed As Long, lngBlue As Long, lngBlack As Long
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngBlue = RGB(0, 0, 255)
If Me.Gender = M Then
Me.Gender.ForeColor = IngBlue
ElseIf Me.Gender = F Then
Me.Gender.ForeColor = IngRed
Else
Me.Gender.ForeColor = IngBlack
End If
The problem:
- The color does not change
- I get no error from the code
-I also tried putting the gender value between quotation marks, but nothing happened.
- I tried the code once in On Current event and once in On Open event, but nothing happened.
Is the code correct or Tabular forms can't be controled in this way?
Best regards
Paulin