You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
Home > Discontinued Software > Access It! Universal > How To... > Programatically Convert A Data Field Value To A Friendly Name Within A BadgeType - Access It! Universal
Programatically Convert A Data Field Value To A Friendly Name Within A BadgeType - Access It! Universal

Overview

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.

  • MkDpt([Department])

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]
    End Select
    End Function

More Information

The attached sample MkDptSample.bdx file contains all of the above code.


Feedback
0 out of 0 found this helpful

Attachments

MkDptSample.bdx
scroll to top icon