hey guys i get an object required on set mac = for the below code
Private Sub txtSERIAL_GotFocus()
Dim oWMIService As Object
Dim oColAdapters As Object
Dim oObjAdapter As Object
Dim mac As String
Dim y As Double
Dim z As Integer
Set oWMIService = GetObject("winmgmts:" & "!\\.\root\cimv2")
Set oColAdapters = oWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each oObjAdapter In oColAdapters
Next
Set mac = oColAdapters
For y = 1 To Len(mac)
If IsNumeric(Mid(mac, y, 1)) Then
z = z & Mid(mac, y, 1)
End If
Next y
Me.txtSERIAL = y
Set oObjAdapter = Nothing
Set oColAdapters = Nothing
Set oWMIService = Nothing
End Sub
any suggestions?
Private Sub txtSERIAL_GotFocus()
Dim oWMIService As Object
Dim oColAdapters As Object
Dim oObjAdapter As Object
Dim mac As String
Dim y As Double
Dim z As Integer
Set oWMIService = GetObject("winmgmts:" & "!\\.\root\cimv2")
Set oColAdapters = oWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each oObjAdapter In oColAdapters
Next
Set mac = oColAdapters
For y = 1 To Len(mac)
If IsNumeric(Mid(mac, y, 1)) Then
z = z & Mid(mac, y, 1)
End If
Next y
Me.txtSERIAL = y
Set oObjAdapter = Nothing
Set oColAdapters = Nothing
Set oWMIService = Nothing
End Sub
any suggestions?