Radio Buttons To Select Database Field For Upc-A Using Vb Script
Hello.
New to BarTender, little to no experience with VB Scripts.
I'm trying to put a label together that will display our stock code, description, lot # and UPC-A code from our Syspro database tables. Label will also include a Data Matrix barcode that returns stock code & lot number and this works fine as is.
We use the same stock code and description for different size box counts that have different UPC-A codes. Our UPC-A codes are in different custom fields tied to the stock code.
I'm trying to have the radio button selection determine the database field to pull from to print the appropriate UPC-A code for the box count. I believe this can be accomplished through VB Script but have been unsuccessful so far.
Here's what I have in my script:
Functions and Subs
'Common subroutines, functions, and variables can be placed here that can be
'referenced by other events.
OnFillList
'Called when the list is populated.
'Use vbCr to separate list items.
'Use vbTab to separate name-value pairs.
Value = "50 Ct Box" + vbTab + Field("InvMaster+.UPC50B") + vbCr + "100 Ct Box" + vbTab + Field("InvMaster+.UPC100B") + vbCr + "250 Ct Box" + vbTab + Field("InvMaster+.UPC250B") + vbCr + "500 Ct Box" + vbTab + Field("InvMaster+.UPC500B") + vbCr + "1000 Ct Box" + vbTab + Field("InvMaster+.UPC1000B") + vbCr + "2000 Ct Box" + vbTab + Field("InvMaster+.UPC2000") + vbCr + "5000 Ct Box" + vbTab + Field("InvMaster+.UPC5000B")
Any help offered is much appreciated.
-
Shotaro Ito
★ BarTender Hero ★
You need to have your own database connection in dropdown's VB script, like topic below.
http://forums.seagullscientific.com/index.php?/topic/595-vb-script-dropdown-list-excel/
0 -
Set a name for the data source that is set by the radio button. This is so we can reference its state in a VB script.
Create a multi-line VB script for the barcode object and use a conditional statement to test the value of the named radio button data source.
Example:
If Format.NamedSubStrings("MyRadioButton").Value ) "X" Then value = Field("Table1.Field1","12345") Else value = Field("Table1.Field2","12345") End If
0 -
You need to have your own database connection in dropdown's VB script, like topic below.
http://forums.seagullscientific.com/index.php?/topic/595-vb-script-dropdown-list-excel/
Shotaro I - I was unable to use your suggestion but thank you for offering assistance just the same.
Set a name for the data source that is set by the radio button. This is so we can reference its state in a VB script.
Create a multi-line VB script for the barcode object and use a conditional statement to test the value of the named radio button data source.
Example:
If Format.NamedSubStrings("MyRadioButton").Value ) "X" Then value = Field("Table1.Field1","12345") Else value = Field("Table1.Field2","12345") End If
Ian C - It took some work, trial and error but I was able to build from your suggestion and now have exactly what I needed. I have a 16 selection radio button input that changes the barcode to the desired UPC-A code from different database fields as named data sources. Thank you. Your assistance is very much appreciated.
0
Please sign in to leave a comment.
Comments
3 comments