Zum Hauptinhalt gehen

Suche

Suche

Validate a form field based on a different field's dropdown list

Kommentare

5 Kommentare

  • Avatar
    Graham JENKINS

    With a little more research, I created a Visual Basic Script named data source of type Event Script, which makes it possible to define an OnPostPrompt event.

    This works, but the dialog box does not allow updating of form data, so it's not ideal.

    0
  • Avatar
    Peter Thane

    Unfortunately there is a not a "between data entry" type VB event (I wish there was) and so the VB has to be processed wither before the data entry or after it. 

    The only way I can think of doing this would be to use an Action button:

    • Right click on the Form 1 and rename it (I called mine EntryForm)
    • Use the Add Form button to add a 2nd form to your label. 
    • add an appropriate message to the form 
    • Right click on the Tab of the new form (is the Form 2 above)
    • Click on the Form 2 name in the column on the left and then on the right hand side change the Show When settings by clicking on the ringed button
    • Adjust the Conditionally Based on Expression options to something similar to the below akthough these would be the Badge and Subcontractor in your instance - I had used different names for my quick test
    • Once done click Ok and then on the previous screen click on the word Form on the left and then the Actions button
    • In the Validate Data option highlight the Continue Printing and press the red X to delete it. Now click on the blue + next to Validate Data to add a new option
    • When it opens click on the Forms and Show Forms option and in the box on the right type in the Form name you set for Form 1 above.
    • Click Ok, Close and Template1 to return to your label view and now test your label. What should happen if nothing is selected the new form will appear and then the operator will be returned to the previous screen.

    I hope this helps

     

    Pete

     

    1
  • Avatar
    Peter Thane

    Sorry meant to add this screen image too

     

    0
  • Avatar
    Graham JENKINS

    Pete,

    That's a good idea. Thanks for your help.

    It's a shame that so few VB events are exposed.

    0
  • Avatar
    Peter Thane

    I agree I do think a OnNewDataForm or similar option would be useful but with the new Actions stuff you can get round some bits.

    Just a thought on the new form it maybe better if you remove the existing buttons (right click on the form and on from the Form Properties button untick "include standard buttons") and instead of adding the Actions command to show the first form there, close that screen and from the Data Entry Control dropdown add a Button. In the Properties for that use the Actions add the command to show the other form. Probably a neater solution than leaving a print button showing.

     

    0

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