Hi Douglas,
I have already tried it before posting again and I always get the same
error.
I am wondering something: could it be possible that when renaming a
form
or
using the same form and save as with a different name could trigge that
kind
of error because this is basically what is hapenning, translating a
form
and
all of it's subforms, save as with a new name, just adding FR at the
end
of
the name. Once I revise the code behind it to make sure the form name
is
correct, this is when I get the error.
Alain
:
If the control name didn't change, does that mean it's still
subfrmBudget
(with form subfrmBudgetFR as its SourceObject)? Try:
Forms![BudgetFR]![subfrmBudget].Form.txtTaxFrom.SetFocus
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
I am not adding anything either to the parent or the subform itself.
It is a form that has been translated from english to french (labels
only,
not the control name itself), and all the references to the form
itself
has
been change to their french name, we just add FR to the form name so
I
can
reference to the proper form, the control name itself did not change
name,
it
remains the same.
This is where I do not get it
alain
:
It does get a little complicated. <g>
Remember that you aren't actually adding a subform to the parent
form:
you're adding a subform control on the parent form, and then
specifying a
specific form to be displayed in that subform control. Depending on
how
you
add the subform control to the parent form, the name of the subform
control
may be different than the name of the form being used as a subform.
You
must
refer to the name of the subform control if they're different.
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hi Douglas,
sorry, but I have modified the syntax based on your
recommendation
and
I
still get the same error on that line error 2465 db cannot fint
the
field
subfrmBusgetFR referred to in your expression, this is extremly
puzzling
since there is no other way to reference control on a subform
Alain
:
The syntax always was
Forms!NameOfParentForm!NameOfSubformControlOnParentForm.Form!NameOfControlOnSubform
In other words, you should have been using (and now apparently
must
use)
Forms![BudgetFR]![subfrmBudgetFR].Form.txtTaxFrom.SetFocus
Some versions of Access are a little pickier than others.
I wouldn't get fussed about the square brackets having been
inserted
for
you: when you don't have spaces in the form or control names,
they're
optional, but okay to include.
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
FYI,
I just look at the some other code and every where I see a
reference
to
a
control on a subform all my code has been changed to the
following:
Forms![BudgetFR]![subfrmBudgetFR].txtTaxFrom.SetFocus
What hapenned here during the conversion?
:
Can anynoe help me with this error.
I have converted a db from 2000 to 2003 and now it give me
this
error
2465..
db cannot the field 'subfrmBudgetFR' referred to in your
expression.
The subform name is spelled properly
I always used the following:
Forms!BudgetFR!subfrmBudgetFR!txtTaxFrom.SetFocus.
I also tried
Forms!BudgetFR!subfrmBudgetFR.form!txtTaxFrom.SetFocus
and
it
gives me the same error..
TIA