Help with If statments

  • Thread starter Thread starter mattc66
  • Start date Start date
M

mattc66

I have the following code and its working okay with one exception. I would
like to add a MsgBox if the stFrt is not one of the if statements. Also I am
not sure if I should be formating this using a Select Case vs IF.

See below Code:

Private Sub TrackingNum_dblClick(Cancel As Integer)

Dim stFrt As String
Dim stPro As String
Dim stHyp As String

stFrt = Me.Carrier
stPro = Me.TrackingNum

If stFrt = "YFT" Then
stHyp = "http://www.myyellow............
If stFrt = "YEL" Then
stHyp = "http://www.myyellow.com/.......
If stFrt = "UPS" Then
stHyp = "http://wwwapps.ups.com/........
If stFrt = "RWY" Then
stHyp = "http://www.quiktrak.roadway.......
If stFrt = "RDW" Then
stHyp = "http://www.quiktrak.roadway.......

Msgbox "Carrier Not Linked", vbInformation, "Carrier Not Found"

End If
End If
End If
End If
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top