C
Charess
I have a case statement in a module which I then call upon in the expression
builder in a query. I hope that this is the correct way to do this.
I had originally had an IF statement in my query that look at the field to
the left of it, but I ran out of characters and received a truncate error.
For some reason I get a datatype mismatch when I open my query.
in query design the expression is: Expr1: callConvert()
Here is the code behind it: Sub Convert()
Select Case UserPri_SecReasons
Case "BJB - BP"
UserPri_SecReasons = "BJB"
Case "BJB - CC"
UserPri_SecReasons = "BJB"
Case "BJO - L"
UserPri_SecReasons = "BJO"
Case "C/B - B"
UserPri_SecReasons = "C/B"
Case Else
UserPri_SecReasons = "Unknown"
End Select
End Sub
___________________________________________________________________
Function callConvert()
Call Convert
End Function
UserPri_SecReasons is the name of the field I need to convert in my query.
All help is appreciated, I've been working at this for hours.
builder in a query. I hope that this is the correct way to do this.
I had originally had an IF statement in my query that look at the field to
the left of it, but I ran out of characters and received a truncate error.
For some reason I get a datatype mismatch when I open my query.
in query design the expression is: Expr1: callConvert()
Here is the code behind it: Sub Convert()
Select Case UserPri_SecReasons
Case "BJB - BP"
UserPri_SecReasons = "BJB"
Case "BJB - CC"
UserPri_SecReasons = "BJB"
Case "BJO - L"
UserPri_SecReasons = "BJO"
Case "C/B - B"
UserPri_SecReasons = "C/B"
Case Else
UserPri_SecReasons = "Unknown"
End Select
End Sub
___________________________________________________________________
Function callConvert()
Call Convert
End Function
UserPri_SecReasons is the name of the field I need to convert in my query.
All help is appreciated, I've been working at this for hours.