Trying to refer to a property that doesn't exist will raise an error (3270,
if memory serves) that you can trap.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I am using a custom DB property to control an expiration date of a demo
> version of an Access app. In order to avoid errors, though, I must first
[quoted text clipped - 6 lines]
>
> Is there any simpler/better way to just check to see if it exists?
> I am using a custom DB property to control an expiration date of a
> demo version of an Access app. In order to avoid errors, though, I
[quoted text clipped - 5 lines]
> the name of the property. Would it be better to do this: If IsNull
> (CurrentDB.Properties("ABC").Name) Then...
That last approach won't work, because it will raise an error (3270,
IIRC) if the property "ABC" doesn't exist.
> Is there any simpler/better way to just check to see if it exists?
What I usually do is refer to the property and trap the error if it
doesn't exist. For example:
On Error Resume Next
varABC = CurrentDb.Properties("ABC").Value
Select Case Err.Number
Case 0
' The property exists
Case 3270 ' ** If I remember right -- check this
' The property doesn't exist
Case Else
MsgBox Err.Description, vbExclamation, "Error " & Err.Number
End Select
On Error GoTo Err_Handler ' reset to normal error-handler

Signature
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Brian - 09 Jan 2006 19:46 GMT
Thanks.
> > I am using a custom DB property to control an expiration date of a
> > demo version of an Access app. In order to avoid errors, though, I
[quoted text clipped - 25 lines]
> End Select
> On Error GoTo Err_Handler ' reset to normal error-handler