LiamH
LiamH

Reputation: 1502

avoiding #error in textbox

I have combobox in a main form and after update, my subform requeries and displays relevant records. My subform is a continuous form not datasheet, if that's relevant. I have a textbox in my main form which refers to the subform. It is currently set as the following:

=[Cat_Section_sub].[Form]![Code_Extension_syntax]

This works fine as long as there are records in my subform. However, when I load the form there aren't any records in my subform. So the textbox displays #Error. Is there anything that I can do, like the Nz function, that will help me avoid displaying this error? The Nz function didn't work.

Upvotes: 1

Views: 2478

Answers (1)

Fionnuala
Fionnuala

Reputation: 91376

Have a look at IsError:

=IIf(Not IsError([Cat_Section_sub].[Form]![Code_Extension_syntax]),[Cat_Section_sub].[Form]![Code_Extension_syntax],0)

Upvotes: 2

Related Questions