Identifying a control (1 Viewer)

David44Coder

Member
Local time
Tomorrow, 01:44
Joined
May 20, 2022
Messages
109
There's a text box named "txtSides" on a Form called "frmRecSelect"
In the debug window I'm attempting to print it's Left Value.
But none of these work, all give various errors , and I wonder where I'm going wrong ?

? form_frmRecSelect!txtsides.left
? forms!frmRecSelect!txtSides.left
? CurrentProject.AllForms("frmRecSelect").txtsides.left
? CurrentProject.AllForms("frmRecSelect")!txtsides.left
? Forms("frmRecSelect").txtSides.left
? forms_frmRecSelect!txtsides.left

Of course I can see txtsides and read it's property sheet, but there's another control I've lost.
It may have been removed, but printing it's position could identify it, or let me change its size temporarily to spot it.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:44
Joined
Oct 29, 2018
Messages
21,455
If you know the name of the missing/hidden control, you can try selecting it from the Selected Control dropdown to select/highlight it.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:44
Joined
Feb 28, 2001
Messages
27,142
Depends on where you are when the debugger has control. If you are in a breakpoint in the class module for that form, it is simply Me.controlname and you don't need to use the complex references.

As to the controls on the form, when you are in the debugger, there is a listbox that contains the names of every currently known control in the context of that form. So it should be easy enough to scroll through that list to find your "lost" control if it still exists.
 

HiTechCoach

Well-known member
Local time
Today, 08:44
Joined
Mar 6, 2006
Messages
4,357
Do you have the Form called "frmRecSelect" opened before trying your code?

It would also help a lot to know what errors message you get.
 

David44Coder

Member
Local time
Tomorrow, 01:44
Joined
May 20, 2022
Messages
109
Thank you... found it.

But a Form opened in design mode and in the debug window, what command should print a property like left or height of a control?
Yes Boyd,form exists and it was in Design mode.
Errorr were "object required", "Access can't find field.."
The expression you entered refers to an object that is closed or
doesn't exist.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:44
Joined
Oct 29, 2018
Messages
21,455
Thank you... found it.

But a Form opened in design mode and in the debug window, what command should print a property like left or height of a control?
Yes Boyd,form exists and it was in Design mode.
Errorr were "object required", "Access can't find field.."
The expression you entered refers to an object that is closed or
doesn't exist.
Access code can't see Forms in Design View. They'll have to be in Normal View. Or, you could open the form in Design View using code and maybe you'll be able to see the properties in code too.
 

David44Coder

Member
Local time
Tomorrow, 01:44
Joined
May 20, 2022
Messages
109
> Access code can't see Forms in Design View.
Thanks.. I'll stop trying then !
 

Users who are viewing this thread

Top Bottom