Hi all,
I would like to display the status of the network connection on a form.
Here is what I have done so far:
1. I put this code in the (General) section of my form:
Then, i created a text box (TextNetwSTS) where I would like the status displayed (UP or DOWN) and in it code, I put:
Disappointing result: the text box remains blank.
Any idea what I did wrong?
Thanks a lot!
I would like to display the status of the network connection on a form.
Here is what I have done so far:
1. I put this code in the (General) section of my form:
Code:
Private Sub Connection_Status()
Dim Network_Cnx As String
If My.Computer.Network.IsAvailable Then
Network_Cnx = "UP"
Else
Network_Cnx = "DOWN"
End If
End Sub
Then, i created a text box (TextNetwSTS) where I would like the status displayed (UP or DOWN) and in it code, I put:
Code:
Private Sub TextNetwSTS_BeforeUpdate(Cancel As Integer)
TexNetwSTS.Value = Network_Cnx.Value
End Sub
Disappointing result: the text box remains blank.
Any idea what I did wrong?
Thanks a lot!