expression problems in subforms

G

Guest

hello
there are 3 forms a,b,c in 1 to 8 relation. form c is nested in form b with
some validate expressions and calculated fields.Then i made the form b,
subform into form a and then all experessions into subform c stopped working.
Expressiond expanded into all three forms.
can anybody helme what im doing wrong?
 
R

Rick Brandt

chill said:
hello
there are 3 forms a,b,c in 1 to 8 relation. form c is nested in form b with
some validate expressions and calculated fields.Then i made the form b,
subform into form a and then all experessions into subform c stopped working.
Expressiond expanded into all three forms.
can anybody helme what im doing wrong?

Any references in a form that go through the Forms collection need to be changed
if the referenced form is used as a subform. For example...

Forms!FormB!ControlName

....will work when FormB is opened on its own, but not if FormB is a subform
inside FormA. Then you would have to use...

Forms!FormA!SubformControlName.Form!ControlName
 
G

Guest

yes thats exactly my problem :)...can you give me an example pls...
in form C there is an expression =IIf([date]=[Forms]![formB]![arrival
date];10;200)
which work fine from form B.
what changes i must do after formB works as subform in FOrm A?
 
R

Rick Brandt

chill said:
yes thats exactly my problem :)...can you give me an example pls...
in form C there is an expression =IIf([date]=[Forms]![formB]![arrival
date];10;200)
which work fine from form B.
what changes i must do after formB works as subform in FOrm A?
"Rick Brandt" wrote:

=IIf([date]=[Forms]![formA]!SubformControlName.Form![arrival date];10;200)

Note that formB is not actually referenced at all. What is referenced is the
form property of the subform control. If you used the wizard or drag n' drop to
create the subform in formA then the subform control will "likely" have the same
name as formB, but that is not guaranteed. The syntax requires the name of the
control, not the form within.
 
G

Guest

well im sure u explain me the solution im looking for but im a little new in
access and its a little difficult to understand what that "form property of
the subform control " is and what this SubformControlName.Form is :)
If you have time it would be great to give me more details pls .

Rick Brandt said:
chill said:
yes thats exactly my problem :)...can you give me an example pls...
in form C there is an expression =IIf([date]=[Forms]![formB]![arrival
date];10;200)
which work fine from form B.
what changes i must do after formB works as subform in FOrm A?
"Rick Brandt" wrote:

=IIf([date]=[Forms]![formA]!SubformControlName.Form![arrival date];10;200)

Note that formB is not actually referenced at all. What is referenced is the
form property of the subform control. If you used the wizard or drag n' drop to
create the subform in formA then the subform control will "likely" have the same
name as formB, but that is not guaranteed. The syntax requires the name of the
control, not the form within.
 
R

Rick Brandt

chill said:
well im sure u explain me the solution im looking for but im a little new in
access and its a little difficult to understand what that "form property of
the subform control " is and what this SubformControlName.Form is :)
If you have time it would be great to give me more details pls .

When you open formA in design view there is a rectangle in which you see formB.
That rectangle is not actually a form. It is a Control like a TextBox or
ComboBox. It is just a particular kind of control, a "subform control" that can
be used to load one form inside of another form. Like any other control on a
form it has a name property. The syntax in my previous post needs to have the
name of the subform control substituted where I wrote "SubFormControlName".
 
G

Guest

Thanks!!!!

Rick Brandt said:
When you open formA in design view there is a rectangle in which you see formB.
That rectangle is not actually a form. It is a Control like a TextBox or
ComboBox. It is just a particular kind of control, a "subform control" that can
be used to load one form inside of another form. Like any other control on a
form it has a name property. The syntax in my previous post needs to have the
name of the subform control substituted where I wrote "SubFormControlName".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top