Problems with Screen.ActiveControl
Private Sub Form_Click()
If Screen.ActiveControl Is Command1 Then
If Screen.ActiveControl Is Command2 Then
If Screen.ActiveControl Is Text1 Then
Randy Birch, MVP Visual Basic
Please correspond only using the newsgroups so all can benefit.
| let's say i have a textbox (text1) and 2 command buttons (edit and
| cancel). Text1 got the Validate event.
| I need to know which control has the focus on a form so i know what to do
| with the validation. In my code, i wanna do something like this
| if screen.activecontrol <> "cancel" then
| do some stuff
| end if
| Right now, screen.activecontrol only gets "" as a value...is there some
| alternative to this? Thanks!