[AccessD] Dang Bound Forms Again

Gustav Brock gustav at cactus.dk
Thu Jun 5 02:47:37 CDT 2003


Hi Rocky

> I have a bound form which displays product structures.  If the product structure table is empty (as it would be when the user is just starting up) the screen comes up blank.  I would like the form
> to display empty without the #Name stuff, of course.

> How do you all solve this problem of a bound form bound to an empty record source?

If the form is for display only, I check initially if any records are
available; if not, I either grey out the control which opens the form,
or pop a message telling the user that nothing is to display. If you
insist to open the form, change the recordsource to one that returns
one empty record simulating the fieldnames and their datatype of the
normal recordset, like:

    SELECT TOP 1
      Null AS YourQueryField1,
      Null AS YourQuryField2,
      0 AS YourQueryField3,
      ...
      "" AS YourQueryFieldN
    FROM
      AnyNotEmptyTable;

If the form is for data entry as well, either your recordset or the
form doesn't allow addition of new records. Correct this.

/gustav



More information about the AccessD mailing list