Wait a minute! Wait a minute!
The is a combo box is there alright, but there is no way to select General from it. It is simply not there.
Respectfully,
Lou Reed
Wait a minute! Wait a minute!
The is a combo box is there alright, but there is no way to select General from it. It is simply not there.
Respectfully,
Lou Reed
What are you trying to find? I thought the discussion was how to find a control on the form.
If this is related to your finding orphaned code, General is at the top, not in alphabetical order.
I still do not see General as a selection.
I am I have opened a form in design view, selected a control, and then let the combo box (drop down menu) open up. There is no General, what else must I do to get this to work.
I am obviously missing something.
Respectfully,
Lou Reed
You didn't answer my question. If this is related to finding orphaned code, the dropdown you want is in the VBA editor, not the properties window.
Yes, it is and I am including a Snagit shot pdf file of the IDE.
I take from what it says in the to check the right box for event declarations. If any are there they are orphaned code.
Is that all there is to it? Just check event declarations and if any are there they are orpahed code. It seems that there should more.
I am confused as to how to get to this IDE.
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
Okay, that system seems to work, but it only works on one form at a time. It select on my first attempt code that is not associated with a control. The code selected (which was presumably orphaned code) was called by VBA code that was associated with a control on a form.
I guess that I am looking for really orphaned code. Something that is not associated in any way shape or form with the control on a form and that includes code that is called by other VBA code that is associated
with a form control.
What procedure does this?
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
It's the VBA editor, Alt-F11 from Access. Yes, it's that simple. With General selected to the left, any orphaned subs in that object will be in the right dropdown.
Okay, but the orphaned code that it showed me is well not really orphaned. The orphaned code is called by another SUB that is not orphaned.
Technically the code is orphaned. But really it is just connected to code that calls it and that code is certainly not orphaned.
What about real orphaned code.
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
Paul -
That needs some clarification. Orphaned subs that are event procedures will be in that right dropdown list, but so will user-written subs and functions that are not event procedures, even if they are referenced (called) by non-orphaned event procedures.With General selected to the left, any orphaned subs in that object will be in the right dropdown.
John
Okay, this link to a thread a few months ago,. Pbaldy wrote in POST # 9 a procedure that is much more universal in application. By that I mean it checks for orphaned code, but in the whole project not just
code associated with a form. This seems much more utilitarian to use.
How does this procedure work. Please elaborate.
The link is below.
Any help appreciated. Thanks in advance.
Respectfully,
Lou Reed
https://www.accessforums.net/showthr...light=orphaned
I'm sure you're right John. It wasn't something I've used, just saw on another of Lou's threads.
Post 9 was not about finding orphaned code, it was for finding an object on a form. Note the text I quoted there. It was meant for a situation where on a crowded form you aren't sure where "TextboxName" physically is. If you select it in that dropdown it will be selected on the form and thus easier to find.
I don't know of any way that Access can do that automatically for you. A technique that I use to test whether a sub is orphaned or not is to change its name (for example just put an 'x' in front of the name), and then try a compile. If the sub is not orphaned, the compile will generate a "sub or function not defined error".What about real orphaned code.
This technique only works reliably for subs that are not event procedures, and it will lead to other compile errors if you test a function.