Thanks for your response.
Assigning a value instead of a defaultvalue doesn't make any difference to
the later error.
And yes, the toggling needs to run based on the client type of the existing
client when the form opens.
Essentially the problem only occurs when an existing client is actioned due
to the fact that the form "clienttype" is not loaded. This form is only
loaded if a new client is created.
bizpro wrote in message
<24177C25-BD4D-46EF-B9B1-7AFC1B055C4D@microsoft.com> :
> Thanks for your response.
>
[quoted text clipped - 49 lines]
>> Also the code toggling the visible property of the controls will be
>> executed regardless of the criterions above, is that the intention?
As far as I can see, your error occurs because the checbox is
Null when you try to use it's value to toggle the other controls
visible property.
Setting the defaultvalue, as you do if the other form is open,
seems to give the checkbox a value, but since you do not
assign neither defaultvalue nor value if the other form isn't
open, then the control will still be Null, causing the error in
the later assigning.
You will either need to assign a value to the control also
if the other form isn't open, or bind the checkbox to a field
in the forms recordsource or use something else to determine
what to assign the .visible property of the other controls.

Signature
Roy-Vidar
bizpro - 23 Jul 2005 13:21 GMT
Thanks Roy,
The checkbox is a bound control denoting client type and can not have a null
value based on the validation settings in the table. The weirdest thing
though, I removed the GoTo and just left the Else: and it now works
perfectly. Why it wouldn't do that for me earlier I don't know. Most
appreciative of your help.
> bizpro wrote in message
> <24177C25-BD4D-46EF-B9B1-7AFC1B055C4D@microsoft.com> :
[quoted text clipped - 66 lines]
> in the forms recordsource or use something else to determine
> what to assign the .visible property of the other controls.
bizpro - 24 Jul 2005 05:22 GMT
The saga continues. I have found the error lies in the fact that the first If
statement is returning a false value instead of True.
Private Sub Form_Load()
If CurrentProject.AllForms(ClientType).IsLoaded Then ...
This code is returning False even when the form ClientType is loaded.
Presumably it cannot see the form because of some setting I have applied,
however, I can't see what it might be.
> > >>> Private Sub Form_Load()
> > >>> If CurrentProject.AllForms(ClientType).IsLoaded Then
[quoted text clipped - 11 lines]
> > >>>
> > >>> End Sub
bizpro - 24 Jul 2005 05:27 GMT
Problem solved - I forgot the quote marks around the form name
> The saga continues. I have found the error lies in the fact that the first If
> statement is returning a false value instead of True.
[quoted text clipped - 22 lines]
> > > >>>
> > > >>> End Sub