PDA

View Full Version : User Form Call help



Emoncada
02-19-2008, 09:43 AM
I have a userform with 18 txtboxes coming down in a row.
I have added vb for it
Private Sub TxtSN18_AfterUpdate()

If Left(TxtSN18.Value, 1) = "S" Then
TxtSN18.Value = Right(TxtSN18.Value, Len(TxtSN18.Value) - 1)
End If

Call CmdPS2_Click

End Sub

I am having a problem with the Call
What it is supposed to do the same action as if I clicked on the CmdPS2 button.

How can I make this work so that after data is entered in TxtSN18 it would do exactly what the CmdPS2_click would do.

Emoncada
02-19-2008, 09:52 AM
My tab order is correct.

Bob Phillips
02-19-2008, 11:02 AM
That should work. What is happening then?

Emoncada
02-19-2008, 11:11 AM
it's doing the Call but instead of it going to TxtSN19.Setfocus the way it's in The Call it's going to TxtQua19.

When I click the CmdPS2 button it works fine.

Bob Phillips
02-19-2008, 12:39 PM
That is because, whatever happens in the clled routine,m it will follow the tab order in the AfterUpdate event.

Emoncada
02-19-2008, 12:47 PM
So how can I make this work because my Tab Order is TxtSN1 - TxtSN54, then TxtQua1 - TxtQua54 only thing is the Call Hides txtSN1 - TxtSN18 and TxtQua1 - TxtQua18. How can i have it go to TxtSN19 after call I already have it as

CmdPS2_Click

TxtSn19.Setfocus

with some other code.