1

Topic: Procedure operation

Colleagues!
At step by step performance in the editor-works
Otherwise is not present-in than there can be a problem?
( Interception-yes)

Private Sub Form_KeyPress (KeyAscii As Integer)
If Me. ActiveControl. Name Like "ctl *" Then
If KeyAscii = 1085 Or KeyAscii = 1076 Then
Me. ActiveControl = Chrw (KeyAscii)
Else
Me. ActiveControl = ""
End If
End If
End Sub

2

Re: Procedure operation

sdku;
I, probably, lagged behind the times, but somehow something seems to me  to appropriate ActiveControl...
And what, generally, should happen?

3

Re: Procedure operation

;
Isak
?
smile

4

Re: Procedure operation

Rivkin Dmitry wrote:

sdku;
I, probably, lagged behind the times, but somehow something seems to me  to appropriate ActiveControl...
And what, generally, should happen?

Quite right!!

5

Re: Procedure operation

Rivkin Dmitry wrote:

sdku;
I, probably, lagged behind the times, but somehow something seems to me  to appropriate ActiveControl...

in this case not ActiveControl, and ActiveControl. Value so basically should work.
Generally it is better to appropriate ActiveControl other variable of type Control right at the beginning and to work already with it since the link to active  can change for a script operating time.
For debugging use Debug. Print - event is caused asynchronously, the link on ActiveControl permanently changes, so in a statics debugging can not work  it is necessary.
To begin with register explicitly.Value if does not earn, replace all subsequent assignments with local variable instead of ActiveControl. The basic problems I do not see.

6

Re: Procedure operation

MrShin;
And still, forgive for stupidity...
ActiveControl is  (type - control)
KeyAscii As Integer - whatever one may do - .
What happens (or what we expect?) at assignment  some number?
As, as it has already been told, ActiveControl it is permanently intercepted by Aksom.

sdku
You pleased me with the answer:
I: - that, generally, should happen?
: - "Quite right!!"
smile

7

Re: Procedure operation

Rivkin Dmitry;
If "it would be appropriated ", it would be operator Set. But here operator Let. Accordingly, attempt will be produced for object to the left of equal sign to find and fulfill Property Let, having attribute "by default" (a blue point in Object Browser).

8

Re: Procedure operation

Rivkin Dmitry

Rivkin Dmitry wrote:

sdku;
I, probably, lagged behind the times, but somehow something seems to me  to appropriate ActiveControl...

truly selected, about  (I am sorry for the muffled answer)