Hi Tony,
If the bytes are in different fields (i.e. 1,2,3 and 4)
then this would be fairly easy, (i.e. <=255 AND >=0)
however I expect that you're talking about one string...?
If so, you could use the Mid function to extract each
number from the string and find out if it's numeric, e.g.:
Dim strMyIP As String
Dim strInput As String
Dim intCount As Integer
strInput = Me.IP_Address
intCount = 0
Do Until intCount = 4
Do Until Mid(strInput,1,1) = "."
If IsNumeric(Mid(strInput,1,1)) Then
strMyIP = strMyIP & Mid(strInput,1)
'chop off the end digit...
strInput = Mid(strInput,2)
Else
MsgBox "Invalid IP Address"
Exit Sub
End If
Loop
If strMyIP >255 Or strMyIP <0 Then
MsgBox "Invalid IP Address"
Exit Sub
Else
strMyIP = ""
intCount = intCount + 1
End If
Loop
MsgBox "Valid IP Address"
Although I've not tested that, something along those
lines should work.
HTH
John C