Hello, trying to implement a global variable iTable that I can increment/decrement and use its value anytime needed.
1. globalvariables module:
2. One of my subs that change its value:
Private Sub txtProduct1_Enter()
iTable = 3
End Sub
3. Sub where I call it with a Select Case
Private Sub populateTxtOnEnter(ByVal copy As String, ByVal iTable As Integer)
Select Case iTable
Case 1
MsgBox "ERROR"
txtClient.Value = copy
textTicket.SetFocus
Case 2
textTicket.Value = copy
txtProduct1.SetFocus
Case 3
txtProduct1.Value = copy
'txtSize1.SetFocus
Case 4
txtSize1.Value = copy
txtQuantity1.SetFocus
'Case 5
'Case 6
'Case 7
Case 8
txtProduct2.Value = copy
txtSize2.SetFocus
Case 9
txtSize2.Value = copy
txtQuantity2.SetFocus
'Case 10
End Select
End Sub
Now, altough I enter txtProduct1 TextBox, and my iTable is changed to 3, when the code reachs the Select Case, it always goes Case 1 and displays "ERROR" MsgBox that I created. I ask you why?
I tried a MsgBox on txtProduct1_Enter and it give me iTable = 3.
Bookmarks