Dropdown Menus And Printing Follow
I have a very simple label to print that involves two codes held in an Excel spreadsheet.
Example; two colums of data:
I have created the label and linked to the spreadsheet and all works fine when scrolling through the data.
On the Prompt design, I have setup a dropdown menu looking at column 1 using the following vb script:
[b]Functions and subs[/b]
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\labels\data.xls';Extended Properties=""Excel 8.0;HDR=YES;"""
Public Function GetNames()
Set objConn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set rs = objConn.Execute("SELECT * FROM [YYY$]")
strNames = ""
do while NOT rs.EOF
strNames = strNames + rs.fields("XXX") + vbCrLf
GetNames = strNames
Value = GetNames()
the idea is that you select from the dropdown list the item in column one and it prints a label with the selected item as one field and the corrosponding data from column two as another field.
There are two problems I am getting:
1/ the first label will not print but is held in the spool until a second print job is sent (i.e. a missing EOF or something)
2/ Whilst the data aligns in the labels design, it does not print out so. If I select C from the dropdown, I should have C and 3 on the label, but I get C and 1.
Please sign in to leave a comment.