Access/VBA Library

PropertyExists

Returns a Boolean indicating if the requested database property exists.

Syntax

PropertyExists( propertyName )
Parameters
Name Type Description
propertyName String Required. The name of the property to be checked.
Return value

Boolean : True when the property exists, otherwise False.

Code
Function PropertyExists(propertyName As String) As Boolean
    Dim x
    
On Error GoTo PropertyExists_error
    
    x = CurrentDb.Properties(propertyName)
    ' Call succesfull: property exists
    PropertyExists = True
PropertyExists_exit:
    Exit Function
    
PropertyExists_error:
    ' Error occured: property does not exist
    PropertyExists = False
    Resume PropertyExists_exit
End Function

Propertytag:PropertyValidationtag:Validation