Hi all,
Below is a list of IF statements that I am trying to run on a form. Each has an ELSE condition and should display required details in the 'Route' field.
However, when running the code I come up with a problem. When the criteria of the IF statements is met the detail displayed in the field is correct, however when the criteria is not met the same ELSE value is used for all IF statements. That is the last one in the list,
Route = "MESSERtf"
Can anyone see where I'm going wrong?!
method depart(var eventInfo MoveEvent)
if USER2 = "TF" AND NHG >=1 then
Route = "FARL_MESStf"
ELSE
if USER2 = "BF" AND NHG >=1 then
Route = "FARL_MESSbf"
ELSE
if USER2 = "WEB" AND THICK <=25 then
Route = "FARLEYweb"
ELSE
if USER2 = "SPBF" AND THICK <=15 then
Route = "FARLEYspbf"
ELSE
if USER2 = "SPTF" AND THICK <=15 then
Route = "FARLEYsptf"
ELSE
if USER2 = "SPWEB" AND THICK <=15 then
Route = "FARLEYspweb"
ELSE
if USER2 = "STF" AND THICK <=25 AND NHG >=1 then
Route = "FARLEYstf"
ELSE
if USER2 = "STF" AND THICK >=26 AND NHG >=1 then
Route = "MESS_HARTstf"
ELSE
Route = "MESSERstf"
Route = "MESSERstf"
Route = "MESS_HARTspweb"
Route = "MESS_HARTsptf"
Route = "MESS_HARTspbf"
Route = "FARL_MESSweb"
Route = "MESSERbf"
Route = "MESSERtf"
endif
endif
endif
endif
endif
endif
endif
endif
Thanks,
Woody.
Below is a list of IF statements that I am trying to run on a form. Each has an ELSE condition and should display required details in the 'Route' field.
However, when running the code I come up with a problem. When the criteria of the IF statements is met the detail displayed in the field is correct, however when the criteria is not met the same ELSE value is used for all IF statements. That is the last one in the list,
Route = "MESSERtf"
Can anyone see where I'm going wrong?!
method depart(var eventInfo MoveEvent)
if USER2 = "TF" AND NHG >=1 then
Route = "FARL_MESStf"
ELSE
if USER2 = "BF" AND NHG >=1 then
Route = "FARL_MESSbf"
ELSE
if USER2 = "WEB" AND THICK <=25 then
Route = "FARLEYweb"
ELSE
if USER2 = "SPBF" AND THICK <=15 then
Route = "FARLEYspbf"
ELSE
if USER2 = "SPTF" AND THICK <=15 then
Route = "FARLEYsptf"
ELSE
if USER2 = "SPWEB" AND THICK <=15 then
Route = "FARLEYspweb"
ELSE
if USER2 = "STF" AND THICK <=25 AND NHG >=1 then
Route = "FARLEYstf"
ELSE
if USER2 = "STF" AND THICK >=26 AND NHG >=1 then
Route = "MESS_HARTstf"
ELSE
Route = "MESSERstf"
Route = "MESSERstf"
Route = "MESS_HARTspweb"
Route = "MESS_HARTsptf"
Route = "MESS_HARTspbf"
Route = "FARL_MESSweb"
Route = "MESSERbf"
Route = "MESSERtf"
endif
endif
endif
endif
endif
endif
endif
endif
Thanks,
Woody.