Often data fields contain a numeric value rather than an actual name making it difficult to display the friendly name on an ID badge. This article outlines how to programatically convert a value to a name.
For example purposes, the following values will be used:
- 10040 = Customer Service
- 10050 = Sales
- 10060 = Technical Support
BadgeType Data Field
The BadgeType data field which requires converting needs to contain the following expression.
The data field within the closed brackets  is the field containing the value which is to be converted to a name. The MkDpt() portion of the expression tells Access It! Universal to apply the function MkDpt() to the data field contained within the parenthesis ().
BadgeType Code Properties
The MkDpt() function needs to be added to the code tab of the BadgeType properties. The code tab is accessed by clicking File | Badge Properties... | Code.
A sample of the code would look like this:
The variables within the Overview section above are shown in italics.
- Function MkDpt(Dpt)
Select case Dpt
Case "10040":MkDpt= "Customer Service"
Case "10050":MkDpt= "Sales"
Case "10060":MkDpt= "Technical Support"
Case Else MkDpt= [Department]
The attached sample MkDptSample.bdx file contains all of the above code.