text box doesn't appear when value is Null

  • Thread starter Thread starter DDT
  • Start date Start date
D

DDT

Probably this is a simple one, but not for me... :)

I have a display form, based on a query. Actually, it's a read-only popup window that shows the result of a query for which the customer can give the input data on another form.

Values of the query appeares in textboxes on the popup. All works fine when there is at least 1 matching record, but when the query has no result the textboxes doesn't show at all. Why is that? Is there a way to make them visible even if the value is Null, and give it a value like "no result" (for strings) or make Null "0" for numbers?

Thanks in advance.
 
The entire detail section of your form is blank if:
- there are no records to display, and
- no new records can be added.

In this case, attempting to read the value of the non-existent text box
generates an error. The result is not a Null - it is Error, since you're
reading a control that does not exist.

You could try placing a text box in the Form Header section, and using IIf()
with IsError() to show whatever you like. However, that doesn't work
properly in all versions of Access either. Particuarly Access 2000 has
problems displaying this kind of thing.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Probably this is a simple one, but not for me... :)

I have a display form, based on a query. Actually, it's a read-only popup
window that shows the result of a query for which the customer can give the
input data on another form.

Values of the query appeares in textboxes on the popup. All works fine when
there is at least 1 matching record, but when the query has no result the
textboxes doesn't show at all. Why is that? Is there a way to make them
visible even if the value is Null, and give it a value like "no result" (for
strings) or make Null "0" for numbers?

Thanks in advance.
 
Back
Top