Hi Rylo,
I tested your code and if it is NOT the right PC it does not let me run the rest of the code if textbox1 stays unchanged. I am quite new to this but this is what I came up with today and it seems to work but seems to not be written properly.
Private Sub CommandBtn1_Click()
Dim aHostName As String
aHostName = Environ$("computername")
If Me.TextBox1 > aVal And aHostName = "LYNPC7318" Then
Call Update
End If
If Me.TextBox1 > aVal And Not aHostName = "LYNPC7318" Then
MsgBox "Wrong PC to update job numbers", vbCritical, "PC Error"
TextBox1 = aVal
TextBox16 = bVal
Exit Sub
Else
'Run remaining code
End If
End Sub
Bookmarks