DroidDB Tip of the Month
DroidDB® Tip for January 2017
Making an Edit Control Required
You might want to designate an edit control as "Required" (i.e. the user had to specify a value in it). This can be done using macros.
Say you wanted designate that the Description edit control of the sample Expenses form is required. First, create a macro (EDIT | MACRO/EVENTS) called CheckDescription:
- Step 1: SKIP if @length(Description) = 0 then 1 else 0
- Step 2: Return from macro
- Step 3: Message box 'Please provide a Description'
- Step 4: Stop macro
Then, change the "On Leaving Record" form event (EDIT | MACROS/EVENTS | EVENTS) to CheckDescription.