Form conditions and other issues
Hey All,
I had a couple quick questions I was hoping someone with more experience could help with. I currently have a template designed with data being pulled from a database. I have document level actions in place executing a SQL if/then/else statement to update if a serial exists, or insert a new row if it does not. The statement currently works and does as intended increasing the "serial" number of the barcode by 1 each time it is printed. I have this action implemented under "for each serial number" in the actions menu. The first issue is that even when doing a print preview to see what labels are printing, it adds records to the database that are not even printed yet when i close out of the preview. I figure this can be fixed with a VB script somewhere, but not sure where.
Next, I have a form that is pulling the serial number field only and currently the user can type in what serial number they want. Current it works as expected. If I enter 6001 and 10 serial numbers it prints 6001-6010 just fine. However, these barcodes are supposed to be sequential, and lets say a user accidentally prints the wrong serial number witha typo. It then gets added to the bottom of the database, and is then "out of order". Is there a way to fix this? And is there a way to force the serial number field to always show the last number that was printed?
Next, We are able to reprint these labels if we need to due to them being damaged or ripped. Currently when the sql script runs it updates the serial number and places "reprint" in the reprinted column of the table. What I want to be able to do is place a reprint text box on the label and hide it if the reprint field is blank ( I currently have this working perfectly with suppression). I then want the form to display a message that warns them "The serial number you have selected has already been printed once, are you sure you want to continue? I found the show message field in the actions, and I can get message to pop up with Yes, no cancel when printing. However, the conditions I am using are not working correctly. I have them set by variable is %Reprinted%=reprint, or even not blank. Neither one works and it doesn't show the error message. However, for testing i reversed it and put is blank. It then displayed the messages on the ones that were blank. The other issue is How can i get the Yes, no, cancel buttons to work as intended. I hit no or cancel, and it continues the print job and adds the record to the database.
Any help is greatly appreciated.
-
1. You could try adding your statement inside another If...then...else statement that references the Global Objects>Format>IsPrintPreview and so if that is True then your VB wont run so that it only runs when you actually print
2. Have you tried applying a Sort inside the database look up/query/filter settings so that the highest number is shown at the top? Not sure if that would work but worth a try.
3. Checkout Reprint Console as that sounds like it will do exactly what you need to do without you having to reinvent the wheel as it were.
0 -
Thanks for the reply Peter.
1. I don't have any VB script running right now, its all a sql if then else statement under the document actions and execute, however, I will try to look into the global objects.
2. I just tried that in the database connection wizard, and went to sql statement and did a SELECT TOP 1 * FROM tablename ORDER BY column name DESC. This worked and it now only shows the last record in the database. However, I now have an issue where if I print, it works fine in bartender designer and moves the serial to the next one, and the form starts at whatever number it shows on my template. I then can go to print portal, and find the template and print from there. The form asks for the starting serial number (which is 1 higher than what is should show on the form as that should have been the last barcode printed). I enter the serial number, and everything prints fine. However, when you go to print another batch it sets the form field back to the "sample data" of the data source instead of using the database number itself. I can then go back to designer, and just do a refresh and save. I can reload print portal and it displays the correct information on the next print. Not sure if this is some type of bug or what.
3. Ive checked into reprint console and looked at some things, but unfortunately it is to limited on what it can do. They have been printing thousands of barcodes a week using excel, and making the barcodes, and taping them to where they go. This obviously is not a best practice, and thats why im trying to implement using labels. If we had to reprint the labels, finding them in reprint console is not a best way, and I want the users to be able to print what they need.
0 -
2. That is odd, what field is the Data Entry box linked to and what are the properties/settings of that field?
3. Not ideal but if they know the number they need to reprint could you create an almost identical label but just make the serial number field a manual entry option so they can just type in that number? I am guessing this would not need to log back to your system.
0 -
Peter,
I think I have everything working as good as I can for now, except for #2.
It is still giving me fits. I talked with support this morning, and they could not get it to work either. Right now, im still only displaying the last record of the database. My barcode on the screen shows TO-001-6700. The last 4 numbers are the serial number. Each number is its own text box. the 6700 text box has a name data source of Serial, and is setup as a database field that pulls from the colum serial. The number that displays matches what is in the database which is perfect. It also shows sample data of Field: Serial (this is apparently what is used when it can't connect to the database). I then go to my form template in designer, and when viewing the form it just says enter starting serial number with one text box. That text box is then linked to the named data source Serial. The text box displays the correct information. while viewing the form template in designer. All number match. Good to go right? Wrong. I then go to print in designer, and when the form pops up it says "enter starting serial number" with the one text box, However instead of the data pulling the last serial number that it shows on the template, it shows Field: Serial (this is the sample data of the named Data Source Serial). I cannot for the life of me figure out why it is doing this. It only changes the value on printing, so something is happening when it is going to print or print preview when it asks for that information, it is not able to pull from the database to get the serial number at that exact time. Is there an option i am missing somewhere?
0 -
Is this the only value read from the database as there maybe a workaround? And is it always they have to choose the last number never any other?
0 -
They can choose others, but it needs to display the last one so they don't have to remember or worry about if someone else printed labels. They can reprint any that are torn by typing in whatever number it was. The sql statement entered just updates the database if the record already exists, and places a new time stamp and reprinted value in. Therefore it will not be the last record. Support emailed me back and says nobody can figure out why it is doing that. Seems like it might be a bug or something.
0 -
Is there a way to just skip the form and just have it print the next serial numbers, and still add them to the database? I don't necessarily even have to have the form. But if i clear it, and try to print, it will print however many I say to print, but not add them to the database.
0 -
If you filter the database so that the latest serial number is at the top and set the Queried Records on the File>Print screen to first record only then BarTender and Print Station will print the latest number every time.
Yes you should be able to skip having the form but you may need to configure where the VB/SQL runs, possibly OnIdenticalCopies would do the trick.
0
Please sign in to leave a comment.
Comments
8 comments