Computing.Net > Forums > Programming > VBA Basic issue

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBA Basic issue

Reply to Message Icon

Name: rikapple
Date: August 5, 2005 at 01:26:37 Pacific
OS: windows xp
CPU/Ram: 512
Comment:

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) + 1

If 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) + 1

If 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



Sponsored Link
Ads by Google

Response Number 1
Name: wizard-fred
Date: August 5, 2005 at 01:41:57 Pacific
Reply:

How is the barcode scanner connected? If it is interfaced correctly you should not lose characters.


0

Response Number 2
Name: rikapple
Date: August 5, 2005 at 03:39:11 Pacific
Reply:

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


0

Response Number 3
Name: wizard-fred
Date: August 5, 2005 at 09:24:57 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Connecting to telnet Usin... Writing to a file from Xc...



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: VBA Basic issue

Help me in DLL's www.computing.net/answers/programming/help-me-in-dlls/12785.html

Batch File|Input from txt file www.computing.net/answers/programming/batch-fileinput-from-txt-file-/17293.html

JAVA is superior to Visual Basic www.computing.net/answers/programming/java-is-superior-to-visual-basic/1927.html