Help: Forms have no controls

J

Jazzy

Please help me. I have a number of forms that do not show controls when the
bound table or quiry has no record. The form's record source is set to
dynaset.


Thanking you in advance
Jazzy
 
F

fredg

Please help me. I have a number of forms that do not show controls when the
bound table or quiry has no record. The form's record source is set to
dynaset.

Thanking you in advance
Jazzy

That is correct.
Add at least one record and you will see the controls.

You can code the form's OPEN event to not open the form if there are
no records:
If Me.RecordsetClone.RecordCount = 0 then
MsgBox "There are no records to display."
Cancel = True
End If
 
R

Rick Brandt

Jazzy said:
Thanks for your reply, unfortunately it does not solve my problem. This forms
are used to capture information. At the end of the year, this data will not be
displayed, only records of the new year will be entered. Again that is were
this problem will re-occur again.

Strangely I do have some forms with no records yet the control don't disapper
when they are opened. I have tried to look at what could be different but I
can't what else to change.

When you still see controls on a form with an empty RecordSet what you are
seeing is the "New-Record" position (like at the bottom of a datasheet with the
*). That new record position is only available if both your form and the
RecordSource allow record additions. If they don't then the detail section goes
blank.

The form header and footer are still visible in this case so you can put a
button or message there that the user will still see. But if you intend this
form to be used to enter/edit data then you have to redesign the query such that
it produces an updateable RecordSet.
 
Top