Is it possible to retrieve the current object's name and maybe even the type of object?
For example in:
Thanks for your help.Please Login or Register to view this content.
Is it possible to retrieve the current object's name and maybe even the type of object?
For example in:
Thanks for your help.Please Login or Register to view this content.
I don't see why you need it in this context. The Sub that you showed is exclusively for an event for the combobox object called cboCity, so why would you need to dynamically determine this? It will always be the same result.
Nevertheless,
But ControlName will always be "cboCity" and ControlType will always be "ComboBox".Please Login or Register to view this content.
Because I've created a sub which takes the control name and its type as parameters.so why would you need to dynamically determine this?
I've just noticed that if the current control is in a frame, it returns the name of the frame.
Is this a bug?
I doubt it's a bug because it has been that way a long time. But I don't know the rationale.
Here is one workaround:
Please Login or Register to view this content.
It's not a bug, VBA is very 'choosy' and if needed would like to know 'where the control is'
You could also query for every control in Framex where the xis the number of the frame.
---
Hans
"IT" Always crosses your path!
May the (vba) code be with you... if it isn't; start debugging!
If you like my answer, Click the * below to say thank-you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks