Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
HELP I am trying to create a simple routine which I want to loop round collecting data. See below :-
Private Sub UserForm_Click()Worksheets("Sheet1").Activate
nvr = Cells(1, 2).Value
End Sub
Private Sub TextBox1_Change()
Worksheets("Sheet1").Activate
nvr = Cells(1, 2).Value
Cells(nvr, 4).Value = TextBox1.Value
TextBox7.Value = TextBox1.Value
End Sub
Private Sub TextBox2_Change()
Worksheets("Sheet1").Activate
nvr = Cells(1, 2).Value
Cells(nvr, 5).Value = TextBox2.Value
If TextBox2 = "GOOD TANK" Then Cells(6, 15).Value = Cells(6, 15).Value + 1
If TextBox2 = "GOOD TANK" Then Cells(1, 2).Value = Cells(1, 2) + 1If TextBox2 = "INTO WIP" Then Cells(6, 16).Value = Cells(6, 16).Value + 1
If TextBox2 = "INTO WIP" Then Cells(1, 2).Value = Cells(1, 2) + 1If TextBox2 = "REJECT TANK" Then Cells(6, 17).Value = Cells(6, 17).Value + 1
If TextBox2 = "REJECT TANK" Then Cells(1, 2).Value = Cells(1, 2) + 1
If TextBox2 = "LINE STOOD" Then Cells(nvr, 10).Value = Now()If TextBox2 = "LINE STOOD" Then TextBox8.Value = "LINE STOOD"
If TextBox2 = "LINE START" Then Cells(nvr, 11).Value = Now()
If TextBox2 = "LINE START" Then TextBox8.Value = "LINE RUNNING"
If TextBox2 = "LINE START" Then Cells(1, 3).Value = Cells(1, 3) + 1
End Sub
I want to record this data to to the excel file then reset the form and move the cursor back to textbox 1 then 2 and repeat again and so on.
I am using a barcode scanner to input the data and this is where the problem occurs. The input is two quick and only half the data is caputured.
Help this is probabally an easy solution but im new and a bit think!
Kind regards to anyone who can help!
RIKAPPLE

the barcode scanner is connected via the ps2keyboard connector.
If i put in a basic loop, it will only grab the first character of the scan, before looping around!!!
Arghh!
RIKAPPLE

The barcode scanner should be set up in the terminated string mode (keyboard emulation mode. The output is the read code followed by a return. Try testing the scanning by running Notepad or Wordpad and scan multiple items. Each bar code should display separately on successive numbers. Most reader can be set to beep if it reads a valid number. If this works then the problem is in your program. You want a string input method instead of a character method. You should be able to type your input with the keyboard. The program should change form when you hit enter.

![]() |
Connecting to telnet Usin...
|
Writing to a file from Xc...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |