Re: Refer to control in procedure
- From: "Michel Walsh" <vanderghast@VirusAreFunnierThanSpam>
- Date: Thu, 4 Jan 2007 12:49:36 -0500
:-)
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
.
- References:
- Refer to control in procedure
- From: Will
- Re: Refer to control in procedure
- From: Michel Walsh
- Refer to control in procedure
- Prev by Date: RE: conditional "required date'
- Next by Date: Re: Direct Hyperlink to Folder
- Previous by thread: Re: Refer to control in procedure
- Next by thread: Re: CanGrow on a form's detail section
- Index(es):
Relevant Pages
|