Zum Hauptinhalt gehen

Suche

Suche

Query Prompt Data Validation

Kommentare

3 Kommentare

  • Avatar
    Domingo Rodriguez
    Moderator

    In BarTender's Database connection setup dialog, select the "Query" tab on the right node once you've select the "database" name on the left node (if you don't use the "Query" tab yet, make sure to setup a query prompt rather than setting up your own query via the "SQL" tab). Now click the "Query Prompts" button and press the "More Options..." button. You can either set up here a minimum number of characters to be automatically filled with " " if you don't enter sufficient characters at print time, or, if you wish something more advanced, you can click on "VB Script" and write some VB Scripting to first check if the data entered is numeric or alphanumeric, and then add 2 extra leading spaces if it's only numeric.

    0
  • Avatar
    Legacy Poster

    I have this set-up all the way to the point where it looks like I need some VB Scripting. But, I don't know Visual Basic. Can someone help me with a script to test the data entered, if it consists of 4 numeric characters, then add 2 leading spaces?

    0
  • Avatar
    Domingo Rodriguez
    Moderator

    You can try using

     

    if IsNumeric (value) Then
        value = "  " & value
    End If
     
    or 
     
    if IsNumeric (value) Then
        value = "  " & CStr (value)
    End If
     
    But I'm not sure if the query prompt value will now match with the value on your database.
     
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.