Using command button to move to next Tab Stop

  • Thread starter Thread starter Nick T
  • Start date Start date
N

Nick T

Hi,

Could anyone tell me if i can use a command button which when clicked, the
'cursor' will move to then next text box in the Tab Stop order??

Any suggestions on code for the command button??

Thanks
 
Hi Nick

You want to move from one tab stop to the next (you could just press enter)
but if you click a command button you will not be at the tab stop you were.

So if you have 2 text boxes 1 & 2
You enter something into [textbox1]
if you press enter or tab you will move to the next tab stop which is
[texbox2]
but if you click a command button how will you programme know which i the
next tab stop
so you will need to set the value (of tab stop 1) into something on your
form - a poss an unbound text box)
then when you click the command button you would go to the next tab stop
after whatever is in the unbound box

this seems a lot of work for something that will work without it

You could use the OnKepPress event or something else to action the event
 
Hi,

Thanks for the clarification - ill see how i get on.
Yes, i seem to be going to all lengths to make this db as user friendly as
possible - i need to reduce possible user error!
It will be used on touch screen PC's so a keyboard or mouse wont be
available to the user, hense all my 'automation' & use of command buttons.

Thanks
Nick

Wayne-I-M said:
Hi Nick

You want to move from one tab stop to the next (you could just press enter)
but if you click a command button you will not be at the tab stop you were.

So if you have 2 text boxes 1 & 2
You enter something into [textbox1]
if you press enter or tab you will move to the next tab stop which is
[texbox2]
but if you click a command button how will you programme know which i the
next tab stop
so you will need to set the value (of tab stop 1) into something on your
form - a poss an unbound text box)
then when you click the command button you would go to the next tab stop
after whatever is in the unbound box

this seems a lot of work for something that will work without it

You could use the OnKepPress event or something else to action the event




--
Wayne
Manchester, England.



Nick T said:
Mmm,

None the wiser im afraid! - not a pro at this stuff yet!
 
That's what I tried to explain him.
Please go to my answer in your previous threat ("Using command buttons")

Paste this right bellow the "Option Compare Database"
Dim strTextBoxName, strTextRecord as String

Add a command button and name it btnSetText and paste this In the click
event routine:
if strTextRecord="" then exit sub
Controls(strTextBoxName).SetFocus
Controls(strTextBoxName) = strTextRecord
strTextRecord=""


And in the rest of 10 buttons replace the code that I gave to you before for
this one:
If Screen.PreviousControl.ControlType = 109 Then
strTextBoxName =Screen.PreviousControl.Name
strTextRecord = strTextRecord & ActiveControl.Caption


Rastro
 
Back
Top