I've been struggling with what I'm sure is a simple problem.
I want to do the following:
I have two Columns/Fields with values in one ranging from '1-3' and values in the other ranging from 'A-E'
I've created a new column Field called RESULTS made to show either U, X or I
So what I'm trying to do is shown in the matrix below:
If the first Field = 1 and the second Field = A then make Field 'RESULTS' = U.
And so on...
0001002003
A00U00U00U
B00U00U00U
C00U00X00X
D00U00X00I
E00U00X00I
I've tried some VBA below, but I can't get it to work.
---------------------------------------------
if [field1] = 0 then
result = "<Null>"
elseif [field1] = 1 then
result = "U"
elseif [field1] = 2 then
if [field2] = "1" or [field2] = "2" then
result = "U"
else
result = "X"
elseif [field1] = 3 then
if [field2] = "1" or [field2] = "2" then
result = "U"
elseif [field2] = "3" then
result = "X"
else
result = "I"
end if
end if
end if
end if
end if
---------------------------------------------
Any advice would be much appreciated.
Bookmarks