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 (April 2010)

Controling the contents of the export file

When creating an export file (OPTION EXPORT) you don't appear to have much control over which columns get exported and their order. But, actually, you can set things up so you can get exactly what you want.

Say you have a table called PARTS with the columns PART_NUMBER, SUPPLIER, DESCRIPTION, QUANTITY_SOLD, and QUANTITY_ON_HAND. Say you have a form (MyForm.vce) that wants to export this as SUPPLIER, PART_NUMBER, QUANTITY (where QUANTITY is QUANTITY_SOLD plus QUANTTY_ON_HAND).

First create another form (EXPORT.VCE), also built over the PARTS table with the following controls:

  1. Edit control over SUPPLIER
  2. Edit control over PART_NUMBER
  3. Calculated control with the expression QUANTITY_SOLD + QUANTITY_ON_HAND
Use Visual CE's FORM | CONTROL ORDER to make sure that they are in this order.

Then, create a macro called MyStartup, with the following steps:

    Step 1: OPTION | EXPORT
    Step 2: RUN EXTERNAL MyForm.vce
and set the "On Startup" event to run MyStartup.

Then, back in MyForm.vce, when you want to do the export, just do a RUN EXTERNAL of EXPORT.VCE.

Previous Tips of the Month