View Full Version : Hide Blank Fields


darno
11-04-2006, 11:30 PM
Hi Friends,

Sounds Impossible But i believe there must be a genius out there to solve this

I was wondering if there is a way to stop displaying fields on a form which contain spaces or blank values. I m using a query that takes data from a table named School

I have a table which have 5 fields. lets say: Field1, Field2, Field3, Field4, Field5

My fields from 1 to 3 have data but field4 and field5 do not have a value in it. What i wish to achieve is to show only those fields which have a value in it. Blank or field with spaces must not be displayed. Is It Possible.

Regards,


Darno

gemma-the-husky
11-05-2006, 01:09 AM
in a form, on the oncurrent event, test each field and say

if isnull(testfield) or field = "" then field.visible = false

you will have to get this working differently depending on the field type - a number field has to test field=0 for instance, not field="".

Another idea is to set field.enabled=false and field.locked=false, which gives a greyed out field setting, which is perhaps more aesthetic than a not visible field.

But part of the idea of forms showing blank values is that it lets users change them if they are wrong.