DroidDB Tip of the Month

DroidDB® Tip for November 2011

Warning the User That There Are No Records

When a DroidDB application is running but there are no records in the underlying table, DroidDB does not allow the user to enter data into the controls (since there would be no where to save the data entered). This can be frustrating for the user because they might not realize they need to first create a record before entering any data.

We accomodated this situation in the sample Expenses application. When the sample Expenses application comes up the first time, the user sees the message "Currently there are no records. Select MENU | RECORD | INSERT to create a record before entering data". This message is not put up automatically by the DroidDB runtime system, it is put up by a startup macro in the form.

To create this macro:

  1. Open the DroidDB development environment. Choose your application and open the form.
  2. Select EDIT | MACROS/EVENTS
  3. Create a new macro called STARTUP. It will have three steps:
      Step 1: SKIP   if @count = 0 then 0 else 1
      Step 2: MESSAGE BOX   'Currently there are no records. Select
            MENU | RECORD | INSERT to create a record before entering data'
      Step 3: RETURN FROM MACRO
  4. Click the EVENTS button
  5. Set the On Startup event to STARTUP. Click OK.
  6. Click CLOSE to close the macro editor.
  7. Select FILE | SAVE to save your work.

 

Back to List »

Visit our store

Top rated! I needed a solid database application development tool for mobile devices. I chose DroidDB for Android OS because it provided a way to get a strong product to market quickly. DroidDB is relational, gives me control over form layout, handles macros, and supports events. It works on all Android versions I have tried and is a great companion product to SYWARE’s VisualCE.

Mark Read, President
SyntegraTech, Inc.

signup for our newsletter