Empty form

M

Max Moor

Hi All,
I have a form that comes up with all the controls hidden if the
underlying query returns no records. Is there a simple property I set to
make these visible, even if there are no records yet?

- Max
 
R

Rick Brandt

Max Moor said:
Hi All,
I have a form that comes up with all the controls hidden if the
underlying query returns no records. Is there a simple property I set to
make these visible, even if there are no records yet?

The appearance of empty controls on a form is only available at the
NewRecord position. If your form and/or the recordset it is bound to do
not allow new record insertions then you get a totally blank detail section
if there are no existing records to display. Controls in the form
header/footer sections will still be visible.
 
T

tina

no, not a property, but you can "fix" it several ways,
depending on your needs.

the easiest way is to add a "Close" command button to the
form's header section. it will show up whether there are
any records or not, so the form can be closed if empty.

is the form going to be used for data entry? if so, make
sure the AllowAdditions property is set to Yes. all bound
controls should be visible, on the New Record line, even
when there are no records.

or you can write code to check the table or recordset to
see if it has any records. set the code in the form's
OnOpen event; if the code determines there are no records,
you can Cancel the Open event.

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top