VB - proper format for this IF statement 追蹤

1
Avatar
Brian Susol

Till today, I have gotten away with having a Single Line Expression for my "SetTrack" field. 

The expression was simply:

Format.NamedSubStrings("PMSetID").Value & " " & Format.NamedSubStrings("SetID").Value & "/" & Format.NamedSubStrings("TrackID")

 

However, I am now in need of making an adjustment.  It PMSetID and SetID are the same, Id like to continue down that path, but if different, id like to make an adjustment.  I cant quite figure out the format here. I have the following, any thoughts would be appreciated.

PM = Format.NamedSubStrings("PMSetID").Value
SET = Format.NamedSubStrings("SetID").Value

If PM = SET
Format.NamedSubStrings("PMSetID").Value & " " & Format.NamedSubStrings("SetID").Value & "/" & Format.NamedSubStrings("TrackID")

Else
Format.NamedSubStrings("PMSetID").Value & " " & Format.NamedSubStrings("TrackID")

end if

 

1 意見

0
Avatar
Brian Susol
評論操作 永久連結

In case anyone else finds it helpful, I believe I have it working

 

PM = Format.NamedSubStrings("PMSetID").Value
SET_ID = Format.NamedSubStrings("SetID").Value

If PM = SET_ID Then
Value = Format.NamedSubStrings("PMSetID").Value & " " & Format.NamedSubStrings("TrackID")
Else
Value = Format.NamedSubStrings("PMSetID").Value & " " & Format.NamedSubStrings("SetID").Value & "/" & Format.NamedSubStrings("TrackID")
End If

登入寫評論。