StringFromGUID Function Example

The following example returns the value of the s_GUID control on an Employees form in string form and assigns it to a string variable. The s_GUID control is bound to the s_GUID field, one of the system fields added to each replicated table in a replicated database.

Sub StringValueOfGUID()
    Dim ctl As Control, strGUID As String

    Set ctl = Forms!Employees!s_GUID
    Debug.Print TypeName(ctl.Value)
    strGUID = StringFromGUID(ctl.Value)
    Debug.Print TypeName(strGUID)
End Sub