Logo

Parry IT Support

Welcome
Login  Sign up
Home Solutions
New support ticket
Check ticket status
Solution home Databases Access (Public)

ACCESS - Get Computer Name Print

Modified on: Wed, 4 May, 2022 at 9:03 AM



Private Sub Command2_Click()

'Declare variable

Dim sHostName As String


        ' Get Host Name / Get Computer Name

          sHostName = Environ$("computername")

'Set field name [PCName] to the variable "sHostName "

PCName = sHostName


End Sub


Notes

https://stackoverflow.com/questions/3551055/how-to-get-name-of-the-computer-in-vba 



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

Related Articles

    Home Solutions Cookie policy
    Help Desk Software by Freshdesk
    Article views count