Solved

Bartender Software +Visual Basic

Posted on 2011-03-08
1
1,678 Views
Last Modified: 2012-05-11
We are using Bartender 9.4.  I'd like some help with the Visual Basic addin.  Basically, we have a lot number (for example, 11030801).  11-year; 03-month; 08-day; 01-constant lot number.  I'd like to have a label where the a "best by" text field is suffixed by a date 3 months extended from the month in the lot number.  In this case, "best by" '06/08/11'.  If this could be done via a prompt for the lot number, or with the lot number as a constant field on the label, itself, that would be most helpful.   Any ideas?
0
Comment
Question by:mrherndon
1 Comment
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 35079508
Hi, I have no idea how to add the field or label because I don't know what the interface is, nor do I know how to get the lot number.  But, if I assume that you can get the lot number into a variable called strLotNumber, this VB code will add three months to that.

Regards,

Rob.
strLotNumber = "11030801"
dteDate = CDate(Mid(strLotNumber, 5, 2) & "-" & MonthName(Mid(strLotNumber, 3, 2), True) & "-" & Left(strLotNumber, 2))
dteBestBy = DateAdd("m", 3, dteDate)
strBestBy = Right("0" & Month(dteBestBy), 2) & "/" & Right("0" & Day(dteBestBy), 2) & "/" & Right(Year(dteBestBy), 2)
MsgBox strBestBy

Open in new window

0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Application Crash 2 25
Use GPO script to report finding a certain file 16 15
Supermicro 91 error 8 38
Excel formula to report date modified 14 29
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question