Removing Null Fields from Record? (1 Viewer)

spacepro

Registered User.
Local time
Today, 05:54
Joined
Jan 13, 2003
Messages
715
Hi Guys,

I have a table with about 12 fields and for each record not every field is completed with data. There is a possibility the structure might need to change.

Basically I want to show only the populated fields on that particular record in the textbox in the following format:

Code:
Field1,Field5,Field9

Fields 1, 5 and 9 are the populated fields, this changes for each record.

I have tried several things including setting canshrink property on report and controls and putting code to hide if the field isnull, but this doesn't add the commas and doesn't move the fields to centralise the data in the textbox.

for example:

I have tried

[Field1]&","&[Field2] etc etc
but this shows the data as
field1,,,,,,field5,,,,,,,field9

Also tried seperate fields for each field with the canshrink property set , no success.
Need to format the data so it shows as the code above.

Any ideas

Andy
 

dcx693

Registered User.
Local time
Today, 00:54
Joined
Apr 30, 2003
Messages
3,265
Haven't tried it myself, but have you tried something like:
IIf(IsNull([Field1],"",[Field1]&",")) & IIf(IsNull([Field2],"",[Field2]&","))
 

spacepro

Registered User.
Local time
Today, 05:54
Joined
Jan 13, 2003
Messages
715
Thanks Dcx

It works a treat. Don't know why I didn't use the Iif statement before.

Many Thanks

Andy
;)
 

dcx693

Registered User.
Local time
Today, 00:54
Joined
Apr 30, 2003
Messages
3,265
Cool. Glad when the theory works in practice!
 

Users who are viewing this thread

Top Bottom