The Access It! Universal.NET badge type designer includes built in VBScript expressions that can be used to customize aspects of the badge data. This article can be used to reference the expressions as well as provide example usage.
Access It! Universal.NET Licensing
The following licensing option must be enabled within the Access It! Universal.NET dongle and is a system wide option.
- ID Badging - Yes
Expression Editor
The expression editor can be opened within the badge type designer by dragging and dropping a field from the badge data list to the layout section. With the field selected the Data property menu on the right hand side can be set to Expression and clicking the Edit icon opens the expression editor
Functions
Name: CDate
Definition: Convert a value into a subtype of a date
Sample Usage: CDate(Fields!UserText1.Value)
Result upon Preview/Print: N/A
Name: CStr
Definition: Convert a value into a subtype of a string
Sample Usage: CStr(Fields!UserNumeric1.Value)
Result upon Preview/Print: N/A
Name: Date
Definition: Returns the current date and time
Sample Usage: System.DateTime.Today
Result upon Preview/Print: 10/9/2020 12:00:00
Name: Format
Definition: Return a string formatted as defined by the format expression
Sample Usage: Format(System.DateTime.Today, "MM/dd/yyyy")
Result upon Preview/Print: 10/09/2020
Sample Usage: Format(Fields!ExpireDate.Value, "dd/MMM/yyyy")
Result upon Preview/Print: 10/NOV/2020
Name: FormatDateTime
Definition: Return a date formatted as defined by the format expression
Sample Usage: FormatDateTime(CDate("2020-10-09 12:45"), vbLongDate)
Result upon Preview/Print: Friday, October 9, 2020
Name: IIF
Definition: Returns one of two parts depending on the evaluation of an expression
Same Usage: IIf(Fields!FirstName.Value = "Bob", "This is Robert", "This is not Robert")
Result upon Preview/Print: "This is Robert"
When a cardholder with the first name Bob is printed, any other record would report "This is not Robert"
Name: InStr
Definition: Returns the first position of the first occurance of one string within another
Sample Usage: InStr(0, Fields!Department.Value, "Sales", vbTextCompare)
Result upon Preview/Print: N/A
Name: IsNull
Definition: Returns a boolean value indicating if a record has a NULL value
Sample Usage: IsNull(Fields!Department.Value)
Result upon Preview/Print: N/A
Name: IsNullOrEmpty
Definition: Returns a boolean value indicating if a record has a NULL value or if the value is empty
Sample Usage: IsNullOrEmpty(Fields!Department.Value)
Result upon Preview/Print: N/A
Name: Lcase
Definition: Returns a string converted to lowercase
Sample Usage: LCase(Fields!FirstName.Value)
Result upon Preview/Print: robert
When a cardholder with the first name ROBERT is printed
Name: Left
Definition: Returns a specific number of characters from the left side of a string
Sample Usage: Left(Fields!FirstName.Value, 5)
Result upon Preview/Print: Rober
When a cardholder with the first name Robert is printed
Name: Len
Definition: Returns the number of characters in a string or the number of bytes used to store a variable
Sample Usage: Len(Fields!FirstName.Value)
Result upon Preview/Print: 6
When a cardholder with the first name Robert is printed
Name: Ltrim
Definition: Removes all leading spaces from the left side of a string
Sample Usage: LTrim(Fields!FirstName.Value)
Result upon Preview/Print: Robert
When a cardholder with the first name " Robert" is printed
Name: Mid
Definition: Returns a specific number of characters from middle of a string
Sample Usage: Mid(Fields!FirstName.Value, 1, 4)
Result upon Preview/Print: ober
When a cardholder with the first name Robert is printed
Name: Right
Definition: Returns a specific number of characters from the right side of a string
Sample Usage: Right(Fields!FirstName.Value, 5)
Result upon Preview/Print: obert
When a cardholder with the first name Robert is printed
Name: Rtrim
Definition: Removes all leading spaces from the right side of a string
Sample Usage: RTrim(Fields!FirstName.Value)
Result upon Preview/Print: Robert
When a cardholder with the first name "Robert " is printed
Name: Str
Definition: Returns a string representation of a number
Sample Usage: Str(Fields!UserNumeric5.Value)
Result upon Preview/Print: N/A
Name: ToTitleCase
Definition: Return a string to title case
Sample Usage: Code.BadgeFunctions.ToTitleCase(Fields!FirstName.Value & Fields!LastName.Value)
Result upon Preview/Print: Robert Test
When a cardholder with the name "roBERT TeST" is printed
Name: Trim
Definition: Returns a string with leading and trailing spaces removed
Sample Usage: Trim(Fields!FirstName.Value)
Result upon Preview/Print: Robert Test
When a cardholder with the name " Robert Test " is printed
Name: Ucase
Definition: Returns a string converted to uppercase
Sample Usage: UCase(Fields!FirstName.Value)
Result upon Preview/Print: ROBERT
When a cardholder with the first name robert is printed
Name: Val
Definition: Returns the numbers contained in a string as numeric values
Sample Usage: FORMAT(VAL("123456"), "0000000000")
Result upon Preview/Print: 0000123456
Access It! Universal.NET Badge Designer
Kronos Barcode and Magstripe Expression
Custom date and time format strings