mikefortune
IS-IT--Management
I am use to Crystal Reports and assigning variables in the expression (formula) builder, i.e.: numberVAR = BLAH
I have a very difficult expression in Access and it tells me that it is either to complex or something and try using variables. How do I assign a variable in Access? I will show below what I did in Crystal that worked and what I tried in access that didn't:
Crystal Formula here:
-------------------------------------
Local numberVar Firstpos;
Local numberVar secondpos;
Firstpos:= InStr({OELIN.Description},"-"
Secondpos:= instr(Firstpos+1, {OELIN.Description}, "-"
If Firstpos > 0 and
Secondpos > 0
then
Trim(mid({OELIN.Description}, Firstpos+1, Secondpos - Firstpos -1))
Else
""
Access Expression Here:
---------------------------------------
Expr1: trim(Mid([INMAST]![Desc1],InStr([INMAST]![Desc1],'-'),(InStr(InStr([INMAST]![Desc1],'-')+1,[INMAST]![Desc1],'-'))-(InStr([INMAST]![Desc1],'-'))))
I have a very difficult expression in Access and it tells me that it is either to complex or something and try using variables. How do I assign a variable in Access? I will show below what I did in Crystal that worked and what I tried in access that didn't:
Crystal Formula here:
-------------------------------------
Local numberVar Firstpos;
Local numberVar secondpos;
Firstpos:= InStr({OELIN.Description},"-"
Secondpos:= instr(Firstpos+1, {OELIN.Description}, "-"
If Firstpos > 0 and
Secondpos > 0
then
Trim(mid({OELIN.Description}, Firstpos+1, Secondpos - Firstpos -1))
Else
""
Access Expression Here:
---------------------------------------
Expr1: trim(Mid([INMAST]![Desc1],InStr([INMAST]![Desc1],'-'),(InStr(InStr([INMAST]![Desc1],'-')+1,[INMAST]![Desc1],'-'))-(InStr([INMAST]![Desc1],'-'))))