I'm working on an Access query; the data is in a linked MySQL database.
Two of the fields are codes (A, M, 1, etc.). There is no translation table, so I did a quick function to supply the "real" meaning of the codes. All of the cases work except where there is no data in the field; the query returns Error# in that field.
Here's the complete function:
Public Function XFERCD(code As String) As String
Select Case code
Case Is = "P"
XFERCD = "Parent is District Employee"
Case Is = "A"
XFERCD = "Moved-Complete Current Yr Only"
Case Is = "V"
XFERCD = "Home Campus Overcrowded"
Case Is = "M"
XFERCD = "Moved-Attended Previous 2 Years"
Case Is = "R"
XFERCD = "Home Campus Rated Unacceptable"
Case Is = "2"
XFERCD = "Bilingual"
Case Is = "1"
XFERCD = "Forbes/TEEMS PK Programs"
Case Is = "3"
XFERCD = "Special Ed"
Case Is = "4"
XFERCD = "Career Technology Program"
Case Is = "5"
XFERCD = "AG Sci/Vet Tech PHS"
Case Is = "7"
XFERCD = "AG Sci/Hort HHS"
Case Is = "8"
XFERCD = "Auto Tech PHS"
Case Is = "9"
XFERCD = "Orchestra CHS"
Case Else (this is what is not working)
XFERCD = "None Given"
End Select
End Function
I've tried Case Else, Case = " ", Case = "", Case Is Null. . . no difference. All return the error.
The table says this field is a text field, 8 characters in length, and will allow zero length.
If anyone has any ideas, I would appreciate it!
Two of the fields are codes (A, M, 1, etc.). There is no translation table, so I did a quick function to supply the "real" meaning of the codes. All of the cases work except where there is no data in the field; the query returns Error# in that field.
Here's the complete function:
Public Function XFERCD(code As String) As String
Select Case code
Case Is = "P"
XFERCD = "Parent is District Employee"
Case Is = "A"
XFERCD = "Moved-Complete Current Yr Only"
Case Is = "V"
XFERCD = "Home Campus Overcrowded"
Case Is = "M"
XFERCD = "Moved-Attended Previous 2 Years"
Case Is = "R"
XFERCD = "Home Campus Rated Unacceptable"
Case Is = "2"
XFERCD = "Bilingual"
Case Is = "1"
XFERCD = "Forbes/TEEMS PK Programs"
Case Is = "3"
XFERCD = "Special Ed"
Case Is = "4"
XFERCD = "Career Technology Program"
Case Is = "5"
XFERCD = "AG Sci/Vet Tech PHS"
Case Is = "7"
XFERCD = "AG Sci/Hort HHS"
Case Is = "8"
XFERCD = "Auto Tech PHS"
Case Is = "9"
XFERCD = "Orchestra CHS"
Case Else (this is what is not working)
XFERCD = "None Given"
End Select
End Function
I've tried Case Else, Case = " ", Case = "", Case Is Null. . . no difference. All return the error.
The table says this field is a text field, 8 characters in length, and will allow zero length.
If anyone has any ideas, I would appreciate it!