How to replace a variable with its value in this express?

  • Thread starter Thread starter Tran Hong Quang
  • Start date Start date
T

Tran Hong Quang

I have code is as follows:

Dim dbs As Database
Dim doc As Document
Dim strKey as string

..................

Set dbs = CurrentDb
Set doc = dbs.Containers("Databases")!UserDefined

debug.print doc.Properties![strKey]

Set doc = Nothing
Set dbs = Nothing

....................

strKey is storing a real property name. For example, it is
holding "ReplicateProject". How to print out
doc.Properties![ReplicateProject]?

Thanks
Tran Hong Quang
 
Try:
Debug.Print doc.Properties(strKey)

That will fail if the proeprty does not have a Value, or does not exist yet.
 
Back
Top