Child Form Standards

These are standards that should be followed in developing child forms. Most of these rules apply when writing Child Form Select SQL.

Rules

  • In your SQL, use the (nolock) optimizer hint. Failure to do so is inexcusable. See SQL Blocking for reasons why.
  • Do not depict a column of the av_flag data type as a 1 or 0. It is easy to display this as a checkbox using this UDF:
SELECT a,b,c, Member = dbo.av_checkbox_html(cst_member_flag, NULL)
FROM ...
  • If you can expect more than 100+ rows in the child form, then don't make a child form. It will be slow, inefficient, and ineffective. Child forms were not designed to hold lots of records. Instead, the user should instead go to a search page. You can have a form hyperlink that takes the user to a search page and defaults certain fields. See the "Registrant Search" on the Events profile page for an example.
  • If you are using a slight variation of the same child form SQL in multiple places, compose a UDF or SP with parameters to consolidate and simplify your code. On the same theme, you might want to develop a view to consolidate complicated data and have the child from SELECT from the View. Don't over-engineer things, but don't build up a complicated system that requires you to change 10 child forms if you want to make one minor change.

Style

  • Generally, put the most important column on the left, if there is such a column. Especially if you enable the goto arrow, the user will associate the goto destination to be that of the value of the left-most column.
  • Show as many columns as can reasonably fit into child form without scrunching or scrolling. In most cases, you can fit 6 or 7 columns.
  • Column headers must use initial capital letters:
  • Wrong:

    SELECT x41_key, [code] = x42_date, [start date] = x42_start_date FROM ...

    Right:

    SELECT x41_key, [Code] = x42_date, [Start Date] = x42_start_date FROM ...

If there is key data in the child record that is in another table, take a moment to JOIN to that table in your child form and display that data. You will be doing the user a favor so they don't have to click the edit to see frequently-viewed data.