G
Guest
Hope this is in the correct discussion group. I have a field in a table where
I have set a custom number format; if the value is an integer it will appear
normally and if the value is Null the words "no record" will appear. Works
great. I want to write a small piece of VBA to look at the value in this
field and calculate a second value based on it but am having a problem
because Select Case is not recognising or responding to the "no record"
value. If I pass an integer value into the function the code runs as expected
but if I pass in "no record" the code still runs as if "no record" were an
integer value. I have not declared SalBatch as any particular data type in my
function because I assume it defaults to Variant and will allow both integer
and "no record" values to be recognised. Any help appreciated on how best to
deal with this.
TIA
Select Case SalBatch
Case Is>=1700
more code here
Case Is<1700
more code here
Case Else
more code here
End Select
I have set a custom number format; if the value is an integer it will appear
normally and if the value is Null the words "no record" will appear. Works
great. I want to write a small piece of VBA to look at the value in this
field and calculate a second value based on it but am having a problem
because Select Case is not recognising or responding to the "no record"
value. If I pass an integer value into the function the code runs as expected
but if I pass in "no record" the code still runs as if "no record" were an
integer value. I have not declared SalBatch as any particular data type in my
function because I assume it defaults to Variant and will allow both integer
and "no record" values to be recognised. Any help appreciated on how best to
deal with this.
TIA
Select Case SalBatch
Case Is>=1700
more code here
Case Is<1700
more code here
Case Else
more code here
End Select