Alylia said:
Thanks for your promt response.
I have tried your suggestion on my subform and it is working perfectly.
However when I tried this syntax =([Exp SubForm].[Form].[txtSumExp]) on
the
main form it does not work. I am getting the error message #Name?.
I realise after running the form that some of the square brackets are
taken
out with this remaining =([Exp SubForm].Form.txtSumExp).
Please advise on what needs to be done.
Remember, you can place a standard text control on a form called "zoo", and
set the data source of that text box
to
LastName.
In other words, the name of the control on the form is NOT related to the
actual data source that it is attached to. MOST of the time we do name the
control the same as the underlying field data source.
A control on a form is just that, a control with a name. A sub-form control
is the same concept, and the name of the sub-form control is often different
then what sub-form the control displays...
So, you don't use the name of the sub-from in the above expression, but the
actual name you used for the sub-form control. They are *usually* the same,
but they don't have to be.....
You try some test code on the main form. Place a button on the main part of
the form. The code behind this test button could be
msgbox me.exp_subform.form.txtSumExp
what does inteli -sense give for the control name of your sub form.
Remember, this name is NOT necessary the same name as the actual sub-form
used for that control...(they likely are the same...but, don't have to be).
So, try making that msgbox command work behind a test button. Once you get
that working, then
you can select the correct values for your expression....
As a side note, the wizard often puts in a space for the control name....I
would suggest DO NOT use spaces in field names, form names, query names, and
especially control names on a form. Spaces in names of things are a royal
pain, and are often the cause of much suffering...