Control with no Value

L

Lamar

I have a combo box on my form whose record source is
query. The query sometimes has no results. The combo box
then has no value. I have a report that takes information
from the combo box.

When I run my report then I get a message stating "the
object has no value". It stating the combo box has no
value. It does not matter if the combo box has value to
me; I just want run my report? Is there something I can do?
 
A

Allen Browne

If both:
- there are no records in the form (e.g. filtered), and
- no new records can be added (read-only source query, or form's Allow
Additions is No)
then the Detail section goes completely blank.
Referring to the non-existent control then gives an error.

If the combo is on the form, but has nothing selected, it does have a value:
probably Null.

You may be able to fix the problem just by turning on the form's
AllowAdditions property. Otherwise you will need to find the context that is
giving you the error, e.g. macro? code? Control Source of a text box on the
report? You can then test for the non-existence of records with this kind of
thing:
Forms("Form1").RecordsetClone.RecordCount > 0
 

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