Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function gDomainLookup(astrColumn As String, astrTable As String, Optional astrWHERE As String = "") As Variant
Dim rs As ADODB.Recordset
Dim strSQL As String
On Error GoTo gDomainLookup_Error
gDomainLookup = Null
Set rs = New ADODB.Recordset
strSQL = "SELECT [" & Trim(astrColumn) & "] FROM [" & Trim(astrTable) & "]"
If Len(Trim(astrWHERE)) Then
strSQL = strSQL & " WHERE " & Trim(astrWHERE)
End If
rs.Open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
gDomainLookup = rs.Fields(0).Value
gDomainLookup_Exit:
If rs.State Then
rs.Close
End If
Set rs = Nothing
Exit Function
gDomainLookup_Error:
MsgBox Err & ":" & Err.Description, vbExclamation, "gDomainLookup ERROR"
DoEvents
gDomainLookup = "* ERROR *"
Resume gDomainLookup_Exit
End Function