Thank you, this link is awesome and very helpful
I think I figured out the reason I got the error, but would like your
help
on fixing it. Not sure why it happened, but you probably will
I was messing around with stuff to try and fix it and remembered I had
deleted all my records in my tables (since I am still in the testing
phase
for this database). The form that was having the problems populates
based
on
a query of a table (all records in the table that are marked as in
inspection). So, to fix the problems, I added a record so that there
would
be
one shown as in inspection and the problem was fine...even the way I
have
coded it. I guess the reason it was giving me the error is since the
query
would have given nothing, I would have been given just a blank form
without
the subform, thus it could not find the subform field I was hiding????
Thats
a guess.
So, I guess I have two questions:
1) If the way I have it coded works, can I keep it that way or would
you
suggest me to fix it. Like I said, I have three subforms and when the
query
has something in it, the subforms/form works fine (hides the field)
even
though the coding doesn't match that provided in the link and your
explanation.
2) How can I fix this problem such that if the query doesn't return
anything, the user won't get this debugging error. It is highly
possible
no
parts will be in inspection and if the go to this form, they'll not
know
what
to do.'
Thanks for the help and the link!
1) Is it okay to keep the code like I have it
2) Is there some code to put in so that if for some reason there are no
records (which could happen given the
--
Michael
:
To refer to a control on a subform, you use:
Forms!NameOfParentForm!NameOfSubformControlOnParentForm.Form!NameOfControlOnSubform
Note that depending on how you added the form as a subform, the name
of
the
subform control on the parent form may be different than the name of
the
form being used as a subform.
For more information about referring to controls on subforms, check
http://www.mvps.org/access/forms/frm0031.htm at "The Access Web".
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Hi, I am having a recurring problem with one of my forms. When I
open
it,
I
get a message that says: Run-time error '2455': You entered an
expression
that has an invalid reference to the property Form/Report.
When I debug, it goes to this line:
Forms![frm_TubesAfterInspection]![frm_TubesToSell
subform1]![Material
Transfer Number2].ColumnHidden = -1
This is basically a field in one of three subforms that I don't want
showing
up (in datasheet view). The form names are all correct and the form
field
is
correct is well. I have a form basically identical to this with the
same
code
etc. that has no problems...any help would be great!