Hello,
I'm writing my first module ever and I'm a bit stuck.
I'm having to put this in a module because the IIF I was using within a query was too long, I assume a module is my only choice?
Anyway here's the code I have so far but it returns "Data Type Mismatch in Criteria Expression"
[SICCode is a number field and I have Expr1: SIC([SICCode]) in the query
Any help would be greatly appreciated.
TIA
I'm writing my first module ever and I'm a bit stuck.
I'm having to put this in a module because the IIF I was using within a query was too long, I assume a module is my only choice?
Anyway here's the code I have so far but it returns "Data Type Mismatch in Criteria Expression"
Code:
Function SIC(SICCode As Integer)
SIC = IIf(SICCode >= 22000 And SICCode < 23000 Or SICCode >= 92000 And SICCode < 93000, "Media & Entertainment")
SIC = IIf(SICCode >= 15000 And SICCode <= 21999 Or SICCode >= 23000 And SICCode < 38000, "Manufacturing")
End Function
[SICCode is a number field and I have Expr1: SIC([SICCode]) in the query
Any help would be greatly appreciated.
TIA