In Access 2000, I am trying to populate one field based on the input from another. The ORIGINAL field would be in one of the following formats:
64532-3
84-1234
45123
For the REVISED field, I need to strip the "-" out in the case of 64532-3 only, so resulting data looks like:
645323
84-1234
45123
I am trying to use an IIF based on an InStr function, but just get errors.
Iif (InStr(1,[ORIGINAL], "-")<>6,[ORIGINAL], LEFT([ORIGINAL], InStr(1,[ORIGINAL], "-")-1) & RIGHT ([ORIGINAL], InStr(1,[ORIGINAL], "-")+1)
What am I missing? I have tried putting the IIF statement in the expression box of SetValue macro, in the control source of the REVISED field and am not getting anywhere fast. Can anyone help?
Thank you in advance for your time.
64532-3
84-1234
45123
For the REVISED field, I need to strip the "-" out in the case of 64532-3 only, so resulting data looks like:
645323
84-1234
45123
I am trying to use an IIF based on an InStr function, but just get errors.
Iif (InStr(1,[ORIGINAL], "-")<>6,[ORIGINAL], LEFT([ORIGINAL], InStr(1,[ORIGINAL], "-")-1) & RIGHT ([ORIGINAL], InStr(1,[ORIGINAL], "-")+1)
What am I missing? I have tried putting the IIF statement in the expression box of SetValue macro, in the control source of the REVISED field and am not getting anywhere fast. Can anyone help?
Thank you in advance for your time.