#error on subform control

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

#error on subform control

Post by Pat »

I have a form with a few subforms, one of the subforms has a bound field that has a default as follows:
=DLookUp("Agent","tbl loc Control")

This works on normal Access 2007 but shows an #Error on the Access 2007 runtime.

Any ideas why?

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: #error on subform control

Post by HansV »

Not really, but does it work if you use

=DLookUp("Agent","[tbl loc Control]")
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: #error on subform control

Post by Pat »

I will check it out, thank you

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: #error on subform control

Post by Pat »

The subform also has a master/child link to a text box on the form which is Null, does this make a difference?

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: #error on subform control

Post by HansV »

That shouldn't make a difference for DLookup, as far as I can tell. But the value of a link field/control on the main form shouldn't be null.
Best wishes,
Hans

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: #error on subform control

Post by Pat »

Fair enough re the DLookup.
I will change the query behind the SubForm to look for the text field to be a value or a Null
I will then delete the master/child link that looks at the text field

Pat
5StarLounger
Posts: 1148
Joined: 08 Feb 2010, 21:27

Re: #error on subform control

Post by Pat »

This is part of a main form (Members) and subforms MembersProperties and MemberComments.
The MembersComments can relate to a Member only (if text box on main form is Null) or
if a MembersProperties record has been selected (non null text box on main form) relates to a Member and MembersProperties.

Is there another way of doing this for this situation?

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: #error on subform control

Post by HansV »

It's hard to visualize how that should work. Could you create a stripped-down copy of the database without sensitive information, zip it and attach the zip file to a reply?
Best wishes,
Hans