Glenn,
the usual way is to make the textbox on the subform bound to a field in the
subform's recordsource. If you want users to type in a value in the subform,
they can do it in the subform or you could open a new form.
Create a form with one field, the textbox can be unbound. Open this form in
acDialog mode either from a button or when the main form opens.
When the user clicks the close button on this new form, code updates the
value into the subform.
Something like this:
Private Sub CloseBtn_Click()
Forms!TheMainForm!TheSubformControlName!txtTextBox = Me.NewFormControlName
Do.Cmd Close acForm, Me.Name
End Sub
Jeanette Cunningham
Glenn Suggs said:
Jeanette,
I tried what you suggested before posting my question but I was looking to
bind the textbox on the subform to a field in a table and allow the user
to
type in the data on the main form. Then I was trying to have code update
the
subform control (and therefore also the table). It seems there would be a
way to do that but I can go back to your suggested method if need be.
Thanks again,
--
Glenn
Jeanette Cunningham said:
Glenn,
from the subform the code looks like this - use it in the control source
of
the text box on the subform
=Parent.txtTextBox
Jeanette Cunningham
I'm trying to load a text box on a subform with the information in a
text
box
on the main form. I can't seem to get it to work as I get the error
message
that the subform can't be found.
I've tried using these pieces of code but they don't work.
Me.sbfSubform.Form!txtTextBox = Me.txtTextBox
and
[Forms]![frmMainForm]![sbfSubForm]!txtTextBox = me.txtTextBox
Can someone help please? Thanks in advance.