Re: Refer to control in procedure



:-)



Vanderghast, Access MVP


"Klatuu" <Klatuu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0632E95D-F84E-4A91-B5D0-DEEA3F30239C@xxxxxxxxxxxxxxxx
This is a good point you bring up. I often forget to warn people code
using
ActiveControl, PreviousControl, or ActiveForm don't do will in debug. But
then I write code that doesn't need to be debugged :)
--
Dave Hargis, Microsoft Access MVP


"Michel Walsh" wrote:

Hi,


nope, because the procedure belongs to the form, not to the control, and
can
be, technically, called from any where, form code, within the
form-module...
(such as TWO controls calling the same _Click procedure IS doable), so no
UNIQUE control is assigned to a _Click procedure...

But you can try to play with Screen.ActiveControl or
Screen.PreviousControl.
Note that code using such control is very hard to debug "step by step"
since
the Screen Active control is modified live by activation of the debugger
screen, though the debugging process.


Hoping it may help,
Vanderghast, Access MVP

"Will" <w1ll1299723@xxxxxxxxxxxxxxxxx> wrote in message
news:504irrF1d7k4bU1@xxxxxxxxxxxxxxxxxxxxx
I have a form with rectangles on it which display the shape of offices.
My
Code is the following:

Private Sub shpAB12567C_Click()
Call SelectLoc "shpAB12567C"
Me.shpAB12567C.BackColor = vbRed
End Sub

Is there a way to pickup the sub name/control name from within the
procedure, to save me from specifying it for each control on the form.
E.g. I'm looking to do the following so I can just copy & paste for
each
control.

Private Sub shpAB12567C_Click()
Call SelectLoc Me.ControlName
Me.ControlName.BackColor = vbRed
End Sub

I have looked at active control but it doesn't work with rectangle
shapes.

thanks






.



Relevant Pages

  • Re: Debugging Interrupt Vector Tables (IVTs)
    ... A more useful question would be centred on why you want to "debug IVT". ... able to debug using the debugger without loosing any control if i debug ... within the bootloader /application. ...
    (comp.os.linux.embedded)
  • Debugging Managed vs Unmanaged code, please help!!!
    ... I'm trying to debug an AutoCAD ObjectARX application written in C++ ... control in one of my dialogs (Actually the control is contained in ... The thing is that now when i debug the debugger loads symbols for my ...
    (microsoft.public.vsnet.debugging)
  • Re: Debugging Interrupt Vector Tables (IVTs)
    ... able to debug using the debugger without loosing any control if i debug ... within the bootloader /application. ...
    (comp.os.linux.embedded)
  • Re: How to refer to "current control" in event handler
    ... I won't be using ActiveControl, then, based on your advice. ... (I was using SendKeys to preset the options in a Find ... > So, yes, I hard-code the name of the control. ... > Public Function MakeHighlightAs Boolean ...
    (microsoft.public.access.forms)
  • Re: .NET / C# equivalent of GetFocus()?
    ... Control control = Control.FromHandle; ... instead the activecontrol of the form/usercontrol is ... > activecontrol of form can be things like the tab control, ... > directly on the form or your usercontrol. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)