Select Case AssetID_Val Case Is = "ND_*" Set pStdAloneTbl = pMap2.StandaloneTable(0) Case Is = "LK_*" Set pStdAloneTbl = pMap2.StandaloneTable(1) Case Is = "PG_*" Set pStdAloneTbl = pMap2.StandaloneTable(2) Case Else MsgBox "Error" pEditor.AbortOperation Exit Sub End Select
The * indicates a 3 digit number which will change each time. I can't work out whether the error is with my Case syntax or with the introduction of the wildcard. Help on both would be appreciated.Ed
Dim AssetID_Val As String = "PG_123" 'this is manually set to test it out Dim srchString As String = Mid(AssetID_Val, 1, 3) Select Case srchString Case "ND_" MsgBox(AssetID_Val & " Found!") Case "LK_" MsgBox(AssetID_Val & " Found!") Case "PG_" MsgBox(AssetID_Val & " Found!") Case Else MsgBox("nothing found!") End Select
Dim srchString As String = Mid(AssetID_Val, 1, 3) Select Case srchString Case "ND_" Set pStdAloneTbl = pMap2.StandaloneTable(0) Case "LK_" Set pStdAloneTbl = pMap2.StandaloneTable(1) Case "PG_" Set pStdAloneTbl = pMap2.StandaloneTable(2) Case Else MsgBox "Error" pEditor.AbortOperation Exit Sub End Select
Hi James,That seems to work fine, thanks!CheersEd
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.