I am currently working on a label in which I am grabbing the data from one field (Element Name), then using data from an equipment field related to phasing. I want to return the data in A phase (Device Equipment A), unless empty, then B unless empty, then C. My vb skills are extremely rusty and I do not remember how to do this for more than two possible outcomes.
Can someone help me with the structure of this statement in order to get the results I seek? Thanks for any time spent helping.
I just drew a blank after the following:
[ElementName] & vbnewline & (...
Solved! Go to Solution.
It would be something like
Function FindLabel ([ElementName], [DEVICEA], [DEVICEB], [DEVICEC] )
If IsNull( [DEVICEA] ) then
If IsNull( [DEVICEB] ) then
Findlabel = [ElementName] & vbnewline & [DEVICEC]
Else
Findlabel = [ElementName] & vbnewline & [DEVICEB]
End if
Else
FindLabel = [ElementName] & vbnewline & [DEVICEA]
End if
End Function
It would be something like
Function FindLabel ([ElementName], [DEVICEA], [DEVICEB], [DEVICEC] )
If IsNull( [DEVICEA] ) then
If IsNull( [DEVICEB] ) then
Findlabel = [ElementName] & vbnewline & [DEVICEC]
Else
Findlabel = [ElementName] & vbnewline & [DEVICEB]
End if
Else
FindLabel = [ElementName] & vbnewline & [DEVICEA]
End if
End Function
After tweaking the fields to match the data, this returned my labels as I wanted them perfectly. Thank you for the help!
Glad to help. Please remember to mark the question as answered.