I know this is probably the simplest of questions, but as I'm learning this completely on my own, I know I may miss a few gimmes. Basically, for my own practice, I'm creating a calculator. Simple, I'm sure. I've created M+, M-, and MR buttons for memory recall. The calculator has 3 text boxes. Top/First & Middle/Second for entering the numbers. The third is the Sum field which is at the bottom.
As it is, I have the MR outputting only to a specific field (Second). I want to figure out how to output the variable to whichever of the First or Second textboxes the cursor is in.
The logic I want to use is pretty basic:
CODE
if focus is on textbox1, output dRecall to textbox1
elseif focus is on textbox2, output dRecall to textbox2
else output dRecall to textbox2.
Here is the code as it sits.
CODE
Private Sub uiMemRecall_Click()
txtSecond.Text = dRecall
End Sub
John