D
DMUM via AccessMonster.com
Hello
I just recently took over a database to add some reporting capabilities. As
I usually do when adding code, I tried to compile it. I keep getting this
error:
"Function call on left-hand side of assignment must returnVariant or object"
This is the Function it is referring to:
Public Function getDistrictCode() As String
On Error GoTo Err_getDistrictCode
getUnionCode = STR_DISTRICT_CODE
GoTo Exit_getDistrictCode
Exit_getDistrictCode:
Exit Function
Err_getDistrictCode:
Resume Exit_getDistrictCode
End Function
I changed it to a variant and then also changed STR_DISTRICT_CODE to a
variant but I still get the same error.
STR_DISTRICT_CODE is tied to another variable - .cboDistrictCode1 which is
populated by a VBA SQL query.
The query is pulling the data from a table which contains "TEXT" fields.
I have 2 questions:
1. How/why is the code working if it won't compile?
2. How do I fix this so the code will compile?
Thank you
I just recently took over a database to add some reporting capabilities. As
I usually do when adding code, I tried to compile it. I keep getting this
error:
"Function call on left-hand side of assignment must returnVariant or object"
This is the Function it is referring to:
Public Function getDistrictCode() As String
On Error GoTo Err_getDistrictCode
getUnionCode = STR_DISTRICT_CODE
GoTo Exit_getDistrictCode
Exit_getDistrictCode:
Exit Function
Err_getDistrictCode:
Resume Exit_getDistrictCode
End Function
I changed it to a variant and then also changed STR_DISTRICT_CODE to a
variant but I still get the same error.
STR_DISTRICT_CODE is tied to another variable - .cboDistrictCode1 which is
populated by a VBA SQL query.
The query is pulling the data from a table which contains "TEXT" fields.
I have 2 questions:
1. How/why is the code working if it won't compile?
2. How do I fix this so the code will compile?
Thank you