Check what Randy Birch has at
http://vbnet.mvps.org/index.html?code/network/macaddressremote.htm
Note: Randy's site is aimed at VB programmers. Because of differences
between the controls available for forms in VB and in Access, many of his
examples can't just be copied into Access. Taking a quick look at this
particular code, though, the only thing that jumped out at me was the
reference to Text1.Text in the Command1_Click sub. In Access, you cannot
refer to a control's Text property unless the control has focus. That means
you need either
Private Sub Command1_Click()
Me!Text1.SetFocus
Me!Text1.Text = GetMACAddress("-")
End Sub
or (probably better)
Private Sub Command1_Click()
Me!Text1.Value = GetMACAddress("-")
End Sub