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

  • Thread starter Tran Hong Quang
  • 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
 
A

Allen Browne

Try:
Debug.Print doc.Properties(strKey)

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top