mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (September 2003)

Jumping to Different Forms Based on a Dropdown Value

On your Visual CE form, you may want to allow the user to choose a value from a dropdown and, based on which value the user selected, jump to one form or another.

For example, you may be building a survey form which has a dropdown with the selections "Adult Male", "Adult Female", and "Child". Based on the value selected, you may want to jump to the MALE.VCE, FEMALE.VCE, or CHILD.VCE.

You can do this with a macro program. The macro will test what value is selected and, based on the selected value, launch the appropriate form.

In the example above, say the drop down saved its value in a column called SUBJECT_TYPE. Here is the macro that will jump to the different forms based on the SUBJECT_TYPE:

Step 1: SKIP, if SUBJECT_TYPE = 'Adult Male' then 0 else 1

Step 2: Jump to form MALE.VCE

Step 3: SKIP, if SUBJECT_TYPE = 'Adult Female' then 0 else 1

Step 4: Jump to form FEMALE.VCE

Step 5: SKIP, if SUBJECT_TYPE = 'Child' then 0 else 1

Step 6: Jump to form CHILD.VCE

When the user uses the form, the user would first make a selection in the dropdown and then press the first button of the macro.