Re: Unbound Text Box in Subform
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Thu, 27 Apr 2006 08:22:08 -0500
Scott wrote:
I have a program with a parent form and two subforms (subform A and subform
B), each subform is located under a separate tab. In subform B I have an
unbound txt box (txtweight) and also a command button to run a report. In
subform A I have a ?weight? field. I?ve written code so that if a person
enters a weight in subform B, it?s automatically recorded in the weight field
of subform A. This works well and if I go from subform B to subform A and
then back to subform B to print the report, this works fine too. My problem
is that if I enter the weight on subform B and then immediately press the
button to print my report, the weight has not yet been written to the subform
A control source for weight and, consequently, doesn?t show up on the report.
I?ve played around with Me.Requery, Me.Refresh, wrote a short recordset
program to try to write it to the file, etc.; obviously if one of these
approaches is correct then I must be putting it in the wrong event?
You could have told us which event you are using to write
the value ot the field/control on subformA, but I'll assume
that it's subformB txtweight's AfterUpdate event. I think
the issue is that the data in subformA has not been saved to
its RecordSource table. If that's the issue, then use code
in the button's Click event to save the record sin subformA:
With Parent.subformA.Form
If .Dirty Then .Dirty = False
End With
--
Marsh
MVP [MS Access]
.
- Prev by Date: Re: How many chars can be displayed in a label?
- Next by Date: Re: Member or Data Member not Found
- Previous by thread: Re: adding information from two seperate tables into one form/.
- Next by thread: RE: Minimize A Form
- Index(es):