I can not solve this one (Userform Focus)

johnsonk

Board Regular
Joined
Feb 4, 2019
Messages
169
Hi, I have a userform with several textboxes and comboboxes some textboxes are populated from a closed workbook (Database) when the one of comboboxes is used. When I scan in the first textbox it is not moving to the next textbox the scanner is set correct the tabs order is set correct now when i run the form in the editor and scan in the first textbox it jumps to the next and works perfect but as soon as I close and reopen the workbook it does not work, this is the only issue I need to resolve now then my project is complete but I can not figure out what the issue is. Has anyone come across this issue before ?
1601059143324.png


VBA Code:
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Zoom = Int(.Height / Me.Height * 90)
Width = .Width
Height = .Height
End With
With GetObject("P:\Stores\DataBase.xlsm")
ComboBox3.List = .Sheets("ALL").Range("B7:B500").Value
End With
Label2.Visible = False
Label3.Visible = False
Label13.Visible = False
Label13.Visible = False
Label14.Visible = False
Label15.Visible = False
Label16.Visible = False
Label17.Visible = False
Label18.Visible = False
Label19.Visible = False
Label20.Visible = False
Label21.Visible = False
Label22.Visible = False
Label23.Visible = False
Label24.Visible = False
ComboBox2.Visible = False
ComboBox3.Visible = False
TextBox8.Visible = False
TextBox9.Visible = False
TextBox10.Visible = False
TextBox11.Visible = False
TextBox12.Visible = False
TextBox13.Visible = False
TextBox14.Visible = False
TextBox15.Visible = False
TextBox16.Visible = False
TextBox17.Visible = False
TextBox18.Visible = False
TextBox19.Visible = False
End Sub
Private Sub ComboBox1_Change()
Worksheets(ComboBox1.Value).Select
    Label2.Visible = True
    ComboBox2.Visible = True
End Sub
Private Sub ComboBox2_Change()
    Label3.Visible = True
ComboBox3.Visible = True

If ComboBox2.Value = "IN" Then
Label14.Visible = True
TextBox9.Visible = True
End If

End Sub
Private Sub ComboBox3_Change()
With GetObject("P:\Stores\DataBase.xlsm")
    TextBox1.Value = .Sheets("ALL").Range("A" & ComboBox3.ListIndex + 7).Value
TextBox2.Value = .Sheets("ALL").Range("C" & ComboBox3.ListIndex + 7).Value
TextBox3.Value = .Sheets("ALL").Range("O" & ComboBox3.ListIndex + 7).Value
TextBox4.Value = .Sheets("ALL").Range("N" & ComboBox3.ListIndex + 7).Value
TextBox5.Value = .Sheets("ALL").Range("T" & ComboBox3.ListIndex + 7).Value
Label9.Visible = True
Label10.Visible = True
ComboBox4.Visible = True
TextBox6.Visible = True

    End With
    Workbooks("DataBase").Close

If TextBox3.Value = "" Then
Label11.Visible = False
Label12.Visible = False
Label18.Visible = False
Label19.Visible = False
Label20.Visible = False
    Label21.Visible = False
    TextBox7.Visible = False
TextBox14.Visible = False
TextBox15.Visible = False
TextBox16.Visible = False
    TextBox17.Visible = False
    ComboBox5.Visible = False

TextBox3.Text = "No Promo"

Me.Image1.Picture = LoadPicture("\\Fps16\Stores\PackScanImages\" & TextBox3.Value & ".JPG")
Else

Me.Image1.Picture = LoadPicture("\\Fps16\Stores\PackScanImages\" & TextBox3.Value & ".JPG")

Label11.Visible = True
Label12.Visible = True
Label18.Visible = True
Label19.Visible = True
Label20.Visible = True
    Label21.Visible = True
    TextBox7.Visible = True
TextBox14.Visible = True
TextBox15.Visible = True
TextBox16.Visible = True
    TextBox17.Visible = True
    ComboBox5.Visible = True

End If
End Sub
Private Sub ComboBox4_Change()
If ComboBox4 = "SLEEVES" Then
Label13.Visible = True
TextBox8.Visible = True
Else
Label13.Visible = False
TextBox8.Visible = False
End If
End Sub
Private Sub TextBox6_Change()
If TextBox6.Value = "" Then
TextBox10.Visible = False
TextBox11.Visible = False
TextBox12.Visible = False
TextBox13.Visible = False
Label15.Visible = False
Label16.Visible = False
Label17.Visible = False
Label18.Visible = False
Else
If TextBox6.Value = 1 Then
TextBox10.Visible = True
TextBox11.Visible = False
TextBox12.Visible = False
TextBox13.Visible = False
Label15.Visible = True
Label16.Visible = False
Label17.Visible = False
Label18.Visible = False
Else
If TextBox6.Value = 2 Then
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = False
TextBox13.Visible = False
Label15.Visible = True
Label16.Visible = True
Label17.Visible = False
Label18.Visible = False
Else
If TextBox6.Value = 3 Then
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = True
TextBox13.Visible = False
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
Label18.Visible = False
Else
If TextBox6.Value = 4 Then
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = True
TextBox13.Visible = True
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
Label18.Visible = True
End If
End If
End If
End If
End If
End Sub
Private Sub TextBox10_AfterUpdate()
If TextBox1.Value = "" Or TextBox10.Value = "" Then Exit Sub
If TextBox1.Value = TextBox10.Value Then
TextBox10.BackColor = vbGreen
End If
If TextBox10.BackColor = vbRed Then
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"There has been a no match scanning error" & vbNewLine & vbNewLine & _
"LINE NUMBER: " & ComboBox1.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"LABEL QTY SELECTED: " & TextBox6.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"LABEL CODE 1 Scanned: " & TextBox10.Value

On Error Resume Next
With xOutMail
.To = ""
'.CC = ""
.Subject = "Stores label code scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing

TextBox10.Text = ""
TextBox10.BackColor = &HFFFFFF
End If
End If
End Sub
Private Sub TextBox11_AfterUpdate()
If TextBox1.Value = "" Or TextBox11.Value = "" Then Exit Sub
If TextBox1.Value = TextBox11.Value Then
TextBox11.BackColor = vbGreen
End If
If TextBox11.BackColor = vbRed Then
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"There has been a no match scanning error" & vbNewLine & vbNewLine & _
"LINE NUMBER: " & ComboBox1.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"LABEL QTY SELECTED: " & TextBox6.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"LABEL CODE 1 Scanned: " & TextBox10.Value & vbNewLine & _
"LABEL CODE 2 Scanned: " & TextBox11.Value

On Error Resume Next
With xOutMail
.To = ""
'.CC = ""
.Subject = "Stores label code scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing

TextBox10.Text = ""
TextBox10.BackColor = &HFFFFFF
TextBox11.Text = ""
TextBox11.BackColor = &HFFFFFF
End If
End If
End Sub
Private Sub TextBox12_AfterUpdate()
If TextBox1.Value = "" Or TextBox12.Value = "" Then Exit Sub
If TextBox1.Value = TextBox12.Value Then
TextBox12.BackColor = vbGreen
End If
If TextBox12.BackColor = vbRed Then
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"There has been a no match scanning error" & vbNewLine & vbNewLine & _
"LINE NUMBER: " & ComboBox1.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"LABEL QTY SELECTED: " & TextBox6.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"LABEL CODE 1 Scanned: " & TextBox10.Value & vbNewLine & _
"LABEL CODE 2 Scanned: " & TextBox11.Value & vbNewLine & _
"LABEL CODE 3 Scanned: " & TextBox12.Value

On Error Resume Next
With xOutMail
.To = ""
'.CC = ""
.Subject = "Stores label code scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing

TextBox10.Text = ""
TextBox10.BackColor = &HFFFFFF
TextBox11.Text = ""
TextBox11.BackColor = &HFFFFFF
TextBox12.Text = ""
TextBox12.BackColor = &HFFFFFF
End If
End If
End Sub
Private Sub TextBox13_AfterUpdate()
If TextBox1.Value = "" Or TextBox13.Value = "" Then Exit Sub
If TextBox1.Value = TextBox13.Value Then
TextBox13.BackColor = vbGreen
End If
If TextBox13.BackColor = vbRed Then
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object
Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"There has been a no match scanning error" & vbNewLine & vbNewLine & _
"LINE NUMBER: " & ComboBox1.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"LABEL QTY SELECTED: " & TextBox6.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"LABEL CODE 1 Scanned: " & TextBox10.Value & vbNewLine & _
"LABEL CODE 2 Scanned: " & TextBox11.Value & vbNewLine & _
"LABEL CODE 3 Scanned: " & TextBox12.Value & vbNewLine & _
"LABEL CODE 4 Scanned: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = ""
'.CC = ""
.Subject = "Stores label code scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing

TextBox10.Text = ""
TextBox10.BackColor = &HFFFFFF
TextBox11.Text = ""
TextBox11.BackColor = &HFFFFFF
TextBox12.Text = ""
TextBox12.BackColor = &HFFFFFF
TextBox13.Text = ""
TextBox13.BackColor = &HFFFFFF

End If
End If
End Sub
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,873
Office Version
  1. 2010
Platform
  1. Windows
Then you must have code in some event somewhere that is turning it to True... the setting cannot change on its own.
 

Some videos you may like

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,049
Office Version
  1. 2010
Platform
  1. Windows
johnsonk, what happens when the focus jumps from textbox10 to textbox12 and you immediately scan into textbox12 ?
 

johnsonk

Board Regular
Joined
Feb 4, 2019
Messages
169

ADVERTISEMENT

Hi, I'm back on to this again I scraped the other workbook just in case it was corrupt and started from scratch again with a slightly different layout and still getting the same issue, I have recorded two short videos to show you what happens when I run the form in the editor and when I run it straight from opening the workbook. 0934 is from the editor & 0935 from opening the workbook, I hope someone can figure this out.


I have a homepage userform with a command button to load the form.

Other than the problem with not jumping to the next textboxes the form still works fine.

Code for the userform:

VBA Code:
[/B]
Private Type Position
Left As Single
top As Single
End Type
Private Sub UserForm_Initialize()
With Application
.WindowState = xlMaximized
Zoom = Int(.Width / Me.Width * 100)
Zoom = Int(.Height / Me.Height * 90)
Width = .Width
Height = .Height
End With
 Dim SourceWB As Workbook
Dim ListItems As Variant
Dim i As Integer
Application.ScreenUpdating = False
With Me.ComboBox3
.Clear
Set SourceWB = Workbooks.Open("P:\Stores\DataBase.xlsm", _
False, True)
ListItems = SourceWB.Worksheets(1).Range("B7", Range("B500").End(xlUp)).Value
SourceWB.Close False
Set SourceWB = Nothing
ListItems = Application.WorksheetFunction.Transpose(ListItems)
For i = 1 To UBound(ListItems)
.AddItem ListItems(i)
Next i
 .ListIndex = -1
 End With
Application.ScreenUpdating = True
End Sub
Private Sub UserForm_Layout()
    Static Pos As Position
Dim Mvd As Boolean
If Pos.Left = 0 Or Pos.top = 0 Then
Pos.Left = Me.Left
Pos.top = Me.top
Exit Sub
End If
Mvd = False
If Me.Left <> Pos.Left Then
Me.Left = Pos.Left
Mvd = True
End If
If Me.top <> Pos.top Then
Me.top = Pos.top
Mvd = True
End If
If Mvd Then
MsgBox "Please don't move me !", vbCritical

End If
End Sub
Private Sub ComboBox1_Change()
Label2.Visible = True
ComboBox2.Visible = True
End Sub
Private Sub combobox2_change()
Label3.Visible = True
ComboBox3.Visible = True
End Sub
Private Sub ComboBox3_Change()
 Application.ScreenUpdating = False
With GetObject("P:\Stores\DataBase.xlsm")
    TextBox1.Value = .Sheets("ALL").Range("A" & ComboBox3.ListIndex + 7).Value
TextBox2.Value = .Sheets("ALL").Range("C" & ComboBox3.ListIndex + 7).Value
TextBox4.Value = .Sheets("ALL").Range("N" & ComboBox3.ListIndex + 7).Value
TextBox5.Value = .Sheets("ALL").Range("T" & ComboBox3.ListIndex + 7).Value
    TextBox3.Value = .Sheets("ALL").Range("O" & ComboBox3.ListIndex + 7).Value
    Workbooks("DataBase").Close

End With

Label4.Visible = True
Label5.Visible = True
Label6.Visible = True
Label7.Visible = True
Label8.Visible = True
Label9.Visible = True
Label10.Visible = True
TextBox1.Visible = True
TextBox2.Visible = True
TextBox3.Visible = True
TextBox4.Visible = True
TextBox5.Visible = True
ComboBox4.Visible = True
ComboBox5.Visible = True

If TextBox3.Value = "" Then
TextBox3.Value = "No Promo"

Me.Image1.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\" & TextBox3.Value & ".JPG")
Else

Me.Image1.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\" & TextBox3.Value & ".JPG")

Label11.Visible = True
Label12.Visible = True
ComboBox6.Visible = True
ComboBox7.Visible = True

Application.ScreenUpdating = True

End If
End Sub
Private Sub combobox4_change()
If ComboBox1 = "IN" And ComboBox4 = "SLEEVES" Then
Label13.Visible = True
ComboBox8.Visible = True
Else
Label13.Visible = False
ComboBox8.Visible = False
ComboBox4.Enabled = False
End If
End Sub
Private Sub ComboBox5_Change()
If ComboBox5.Value = "" Then
TextBox6.Visible = False
TextBox7.Visible = False
TextBox8.Visible = False
TextBox9.Visible = False
Else
If ComboBox5.Value = 1 Then
Label15.Visible = True
TextBox6.Visible = True
TextBox7.Visible = False
TextBox8.Visible = False
TextBox9.Visible = False
ComboBox5.Enabled = False
TextBox6.SetFocus
Else
If ComboBox5.Value = 2 Then
Label15.Visible = True
Label16.Visible = True
TextBox6.Visible = True
TextBox7.Visible = True
TextBox8.Visible = False
TextBox9.Visible = False
ComboBox5.Enabled = False
TextBox6.SetFocus
Else
If ComboBox5.Value = 3 Then
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
TextBox6.Visible = True
TextBox7.Visible = True
TextBox8.Visible = True
TextBox9.Visible = False
ComboBox5.Enabled = False
TextBox6.SetFocus
Else
If ComboBox5.Value = 4 Then
Label15.Visible = True
Label16.Visible = True
Label17.Visible = True
Label18.Visible = True
TextBox6.Visible = True
TextBox7.Visible = True
TextBox8.Visible = True
TextBox9.Visible = True
ComboBox5.Enabled = False
TextBox6.SetFocus
End If
End If
End If
End If
End If
Label24.Visible = True
Label25.Visible = True
TextBox14.Visible = True
TextBox15.Visible = True
TextBox16.Visible = True
TextBox17.Visible = True
If ComboBox6.Visible = True Then
TextBox6.Enabled = False
TextBox7.Enabled = False
TextBox8.Enabled = False
TextBox9.Enabled = False
ComboBox5.Enabled = False
End If
End Sub
Private Sub ComboBox6_Change()
ComboBox6.Enabled = False
End Sub
Private Sub combobox7_Change()
If ComboBox7.Value = "" Then
TextBox10.Visible = False
TextBox11.Visible = False
TextBox12.Visible = False
TextBox13.Visible = False
Else
If ComboBox7.Value = 1 Then
Label20.Visible = True
TextBox10.Visible = True
TextBox11.Visible = False
TextBox12.Visible = False
TextBox13.Visible = False
Else
If ComboBox7.Value = 2 Then
Label20.Visible = True
Label21.Visible = True
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = False
TextBox13.Visible = False
Else
If ComboBox7.Value = 3 Then
Label20.Visible = True
Label21.Visible = True
Label22.Visible = True
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = True
TextBox13.Visible = False
Else
If ComboBox7.Value = 4 Then
Label20.Visible = True
Label21.Visible = True
Label22.Visible = True
Label23.Visible = True
TextBox10.Visible = True
TextBox11.Visible = True
TextBox12.Visible = True
TextBox13.Visible = True
End If
End If
End If
End If
End If
ComboBox7.Enabled = False
TextBox6.Enabled = True
TextBox7.Enabled = True
TextBox8.Enabled = True
TextBox9.Enabled = True
TextBox6.SetFocus
End Sub
Private Sub TextBox6_Change()
TextBox6.Text = UCase(TextBox6.Text)
End Sub
Private Sub TextBox6_AfterUpdate()
If TextBox1.Value = "" Or TextBox6.Value = "" Then Exit Sub
If TextBox1.Value = TextBox6.Value Then
TextBox6.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox6.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Label Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox7_Change()
TextBox7.Text = UCase(TextBox7.Text)
End Sub
Private Sub TextBox7_AfterUpdate()

If TextBox1.Value = "" Or TextBox7.Value = "" Then Exit Sub
If TextBox1.Value = TextBox7.Value Then
TextBox7.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox7.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Label Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox8_Change()
TextBox8.Text = UCase(TextBox8.Text)
End Sub
Private Sub TextBox8_AfterUpdate()

If TextBox1.Value = "" Or TextBox8.Value = "" Then Exit Sub
If TextBox1.Value = TextBox8.Value Then
TextBox8.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox8.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Label Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox9_Change()
TextBox9.Text = UCase(TextBox9.Text)
End Sub
Private Sub TextBox9_AfterUpdate()

If TextBox1.Value = "" Or TextBox9.Value = "" Then Exit Sub
If TextBox1.Value = TextBox9.Value Then
TextBox9.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox9.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Label Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox10_Change()
TextBox10.Text = UCase(TextBox10.Text)
End Sub
Private Sub TextBox10_AfterUpdate()

If TextBox3.Value = "" Or TextBox10.Value = "" Then Exit Sub
If TextBox3.Value = TextBox10.Value Then
TextBox10.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox10.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Promo Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox11_Change()
TextBox11.Text = UCase(TextBox11.Text)
End Sub
Private Sub TextBox11_AfterUpdate()

If TextBox3.Value = "" Or TextBox11.Value = "" Then Exit Sub
If TextBox3.Value = TextBox11.Value Then
TextBox11.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox11.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Promo Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox12_Change()
TextBox12.Text = UCase(TextBox12.Text)
End Sub
Private Sub TextBox12_AfterUpdate()

If TextBox3.Value = "" Or TextBox12.Value = "" Then Exit Sub
If TextBox3.Value = TextBox12.Value Then
TextBox12.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Kenny\PackScanImages\PASS.JPG")
Else
TextBox10.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Kenny\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
Dim wb As Workbook
On Error Resume Next
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Promo Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub TextBox13_Change()
TextBox13.Text = UCase(TextBox13.Text)
End Sub
Private Sub TextBox13_AfterUpdate()

If TextBox3.Value = "" Or TextBox13.Value = "" Then Exit Sub
If TextBox3.Value = TextBox13.Value Then
TextBox13.BackColor = vbGreen
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\PASS.JPG")
Else
TextBox10.BackColor = vbRed
Me.Image2.Picture = LoadPicture("\\Fps16\public\Stores\PackScanImages\FAIL.JPG")
Application.Speech.Speak "FAIL"
Dim sPath As String
result = MsgBox("THIS LABEL CODE DOES NOT MATCH THE PRICE SHEET", vbOKOnly + vbCritical, "WARNING")
If result = vbOK Then
Dim xOutApp As Object
Dim xOutMail As Object

Dim xMailBody As String
On Error Resume Next
Dim wb As Workbook
Set xOutApp = CreateObject("Outlook.Application")
Set xOutMail = xOutApp.CreateItem(0)
xMailBody = "WARNING" & vbNewLine & vbNewLine & _
"Wrong Promo Code Scanned" & vbNewLine & vbNewLine & _
"BOOK IN / OUT: " & ComboBox1.Value & vbNewLine & _
"LINE NUMBER: " & ComboBox2.Value & vbNewLine & _
"PRODUCT CODE: " & ComboBox3.Value & vbNewLine & _
"LABEL CODE ON PRICE SHEET: " & TextBox1.Value & vbNewLine & _
"PRODUCT DESCRIPTION: " & TextBox2.Value & vbNewLine & _
"PROMOTION CODE: " & TextBox3.Value & vbNewLine & _
"PROMOTION DESCRIPTION: " & TextBox4.Value & vbNewLine & _
"VERSION: " & TextBox5.Value & vbNewLine & _
"LABEL TYPE: " & ComboBox4.Value & vbNewLine & _
"LABEL QTY SELECTED: " & ComboBox5.Value & vbNewLine & _
"LABEL CODE SCAN 1: " & TextBox6.Value & vbNewLine & _
"LABEL CODE SCAN 2: " & TextBox7.Value & vbNewLine & _
"LABEL CODE SCAN 3: " & TextBox8.Value & vbNewLine & _
"LABEL CODE SCAN 4: " & TextBox9.Value & vbNewLine & _
"PROMOTION TYPE: " & ComboBox6.Value & vbNewLine & _
"LABEL QTY SELETED: " & ComboBox7.Value & vbNewLine & _
"PROMO CODE SCAN 1: " & TextBox10.Value & vbNewLine & _
"PROMO CODE SCAN 2: " & TextBox11.Value & vbNewLine & _
"PROMO CODE SCAN 3: " & TextBox12.Value & vbNewLine & _
"PROMO CODE SCAN 4: " & TextBox13.Value

On Error Resume Next
With xOutMail
.To = "my.email"
'.CC = "my.email"
.Subject = "Stores scanning error"
.Body = xMailBody
.Attacments = ActiveSheet
.Send
End With
On Error GoTo 0
Set xOutMail = Nothing
Set xOutApp = Nothing
Unload kentrack
homepage.Show
End If
End If
End Sub
Private Sub textbox14_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    Dim i As Long, lastrow As Long
    lastrow = Sheets("Info").Range("D" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
If Sheets("Info").Cells(i, "D").Value = (Me.TextBox14) Or _
Sheets("Info").Cells(i, "D").Value = Val(Me.TextBox14) Then
Me.TextBox15 = Sheets("Info").Cells(i, "C").Value
Exit Sub
End If
Next

MsgBox "No Id found"
TextBox14.Text = vbNullString
TextBox15.Text = vbNullString
TextBox14.SetFocus
Cancel = True
End Sub
Private Sub TextBox15_Enter()
Dim lastrow As Long, Ws As Worksheet
Set Ws = ActiveSheet
lastrow = Ws.Range("Q" & Rows.Count).End(xlUp).Row + 1
Ws.Range("Q" & lastrow).Value = TextBox15.Text
TextBox16.SetFocus
End Sub
Private Sub TextBox16_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
Dim i As Long, lastrow As Long
lastrow = Sheets("Info").Range("B" & Rows.Count).End(xlUp).Row
For i = 2 To lastrow
If Sheets("Info").Cells(i, "B").Value = (Me.TextBox16) Or _
Sheets("Info").Cells(i, "B").Value = Val(Me.TextBox16) Then
Me.TextBox17 = Sheets("Info").Cells(i, "A").Value
Exit Sub
End If
Next
MsgBox "No Id Found"
TextBox16.Text = vbNullString
TextBox17.Text = vbNullString
TextBox16.SetFocus
Cancel = True
End Sub
Private Sub TextBox17_Change()
Dim lastrow As Long, Ws As Worksheet
Set Ws = ActiveSheet
lastrow = Ws.Range("R" & Rows.Count).End(xlUp).Row + 1
Ws.Range("R" & lastrow).Value = TextBox17.Text

TextBox18.Value = Now()
TextBox18 = Format(TextBox18.Value, "dd/mm/yyyy hh:mm:ss")
Call Submit_Data
homepage.Show
Unload kentrack
End Sub
Private Sub CommandButton1_Click()
Unload kentrack
kentrack.Show
End Sub
Private Sub CommandButton2_Click()
Unload kentrack
homepage.Show
End Sub
Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
MsgBox "Clicking the Close button does not work."
Cancel = True
End If
End Sub
[B]
 

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,049
Office Version
  1. 2010
Platform
  1. Windows
For test purposes, I would add a STOP instruction as the first line of both _Change and _AfterUpdate events for the first scan textbox only.
Save and Close the workbook.
Run from opening the workbook and when the code execution comes to the STOP instruction things will halt so you can
use the F8 key to execute the code one line at a time and see where the code goes.
 

johnsonk

Board Regular
Joined
Feb 4, 2019
Messages
169

ADVERTISEMENT

I have tried the STOP instruction and gone through the code using F8 and it executed as is should and jumped to the next textbox.
 

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,049
Office Version
  1. 2010
Platform
  1. Windows
That's good, glad you've now got it sorted out.
 

johnsonk

Board Regular
Joined
Feb 4, 2019
Messages
169
NoSparks, It’s not sorted out it worked using the stop then F8 but when using normal it doesn’t work.
 

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
1,049
Office Version
  1. 2010
Platform
  1. Windows
Sorry, too goofy for me to figure out.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,590
Messages
5,625,674
Members
416,125
Latest member
NeedExcelHelp2021

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top