K
Kevin Sprinkel
I am simulating an Excel spreadsheet with overlapping
controls, txtFormula and txtResult. The result is
normally displayed. When the user enters the cell, the
OnFocus event procedure disables the cell and makes it
invisible, and sets the focus to the txtFormula control.
The txtFormula_Exit procedure then resets the control
properties.
Because of the Tab Order, passing through the controls is
different in one direction from the other. I thought a
solution might be to determine what key was pressed on
entering the txtResult control, and let the txtFormula
LostFocus procedure move the focus explicitly based on the
key's value.
Can anyone tell me how I might do this?
Thank you.
Private Sub txtResult_GotFocus()
On Error Resume Next
With Me!txtFormula
.Enabled = True
.Visible = True
.SetFocus
End With
With Me!txtResult
.Enabled = False
.Visible = False
End With
End Sub
Private Sub txtFormula_LostFocus()
On Error Resume Next
With Me!txtResult
.Enabled = True
.Visible = True
End With
With Me!txtFormula
.Enabled = False
.Visible = False
End With
End Sub
controls, txtFormula and txtResult. The result is
normally displayed. When the user enters the cell, the
OnFocus event procedure disables the cell and makes it
invisible, and sets the focus to the txtFormula control.
The txtFormula_Exit procedure then resets the control
properties.
Because of the Tab Order, passing through the controls is
different in one direction from the other. I thought a
solution might be to determine what key was pressed on
entering the txtResult control, and let the txtFormula
LostFocus procedure move the focus explicitly based on the
key's value.
Can anyone tell me how I might do this?
Thank you.
Private Sub txtResult_GotFocus()
On Error Resume Next
With Me!txtFormula
.Enabled = True
.Visible = True
.SetFocus
End With
With Me!txtResult
.Enabled = False
.Visible = False
End With
End Sub
Private Sub txtFormula_LostFocus()
On Error Resume Next
With Me!txtResult
.Enabled = True
.Visible = True
End With
With Me!txtFormula
.Enabled = False
.Visible = False
End With
End Sub