Dynamically return Full Object Reference String

  • Thread starter Thread starter Jeff PC via AccessMonster.com
  • Start date Start date
J

Jeff PC via AccessMonster.com

Is there a function that will take an Object as input and return a string
that corresponds to an absolute reference to the object. In other words I am
imagining a function like:

Function GetObjectRef(TargetObject As Object) As String

So that if an object like Forms![MyParentForm]![MySubForm] was placed in the
above function it would return "Forms![MyParentForm]![MySubForm]" as a string?
 
Jeff,

The unsupported ObjPtr() function will return a pointer to an object. It
returns a numeric pointer, not a string.
ObjPtr(Forms![MyParentForm]![MySubForm].Form)

But if all you want is the object name, then why not:
Forms![MyParentForm]![MySubForm].Form.Name

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
(Currently in Japan)
 
Back
Top