Accessing input form data and database data at the same time
Hello. I've built a Bartender-label that simultaneously utilizes the data entered from the Bartender form and the data entered into the Excel file. Through the Bartender-Form I enter e.g. lot information and date of manufacture. The Excel file (database) contains other standard information about the product. When I print the label, it first asks me to select the row data from Excel and then fill in the missing data from the Bartender form.
I would like Bartender to generate the expiration date of the product printed on the label based on the manufacturing date given in the Bartender form and the shelf life defined in the Excel form.
If I only use the information from the form, I can print the manufacturing date and expiration date on the label using the following VB script:
DateAdd("d", 14, Format.NamedSubStrings("ProductionDate").Value)
However, I would like to replace the amount of time in the formula (14 days in the example) with the time specified in the Excel row.
In other words, when I enter from Bartender-Form e.g. data 10.2.2025, then Bardender would retrieve the usage time from the Excel row (14 days) I selected and return the last usage date (24.2.2025) to the label after the calculation. How was this feasible?
My idea is that the information should first be fetched from the database for the variable and then get the VB script working on the basis of this information. But how?
-
Yes that is possible.
You would need to make the VB Script an Event Controlled Script set to OnNewRecord and then amend the VB command to replace the "14" by double clicking on the name of the database field in the column on the right, so you would get something like this
0
Please sign in to leave a comment.
Comments
1 comment