"deko" <de**@hotmail.c om> wrote in
news:KE******** *********@newss vr27.news.prodi gy.com:
That is, the form has a Controls collection and a Fields
collection. The latter is all the fields in the underlying
recordset, not all of which need appear in controls on the form.
Hmmm... I guess that means I don't need to use a hidden (i.e.
visible = no) text box on a form to hold stuff like ID numbers. I
was in the habit of putting hidden text boxes on the form whenever
I needed to do stuff like this:
Private Sub Categories_Clic k()
Dim intCatId As Integer
intCatId = Me!Cat_ID '<<== Cat_ID text box on form
CallSomeFunctio n (intCatId)
End Sub
I've been experimenting - even the Link Child/Link Master
properties for Sub Forms/Main Forms seems to work without the
hidden text box - Is there ever a time when I need to use a hidden
text box on a form to hold an ID number?
Heavens yes!
However, there's one circumstance where you'll want to use a hidden
field -- if you're referring to a field in the parent from from a
subform. If you don't use the hidden control, in A2K and higher, you
may end up with the dreaded Error 2486 (Google on it, and my email
address with the ".invalid" and you'll see the hair pull I went
through to diagnose it).
That is, if in a subform, you refer to:
Me.Parent!Field NameFromRecordS ource
you may run into the error, which is actually due to a problem in
MSCVRT.DLL.
The problem does not occur if the reference is to a control with a
control source pointing you your desired field.
That is the only situation in which I ever use hidden fields.
Mostly.
I sometimes have ID fields on the form that I have visible during
development but hide for distribution.
--
David W. Fenton
http://www.bway.net/~dfenton
dfenton at bway dot net
http://www.bway.net/~dfassoc