Referencing Sub Form TextBox

V

VBeejit

Hi,

Having read thru previous postings I am trying to use the
Dbl_Click event of a SubFrm named CDMachSubFrm, within
CustDetFrm where it is named sCDMachSubFrm, and the
TextBox within the continuos form that you Dbl click is
named txtSerNum. This should then open another form based
on myQry1 with a Criteria against matching field SerNum
worded thus:
[Forms]![CustDetFrm]![sCDMachSubFrm].[Form]![txtSerNum]

The 2nd form MCSelFrm opens & displays the data correctly
in all the bound fields, but if I try and calculate
additional totals etc. from the On_Load or On_Open event
of the form to display in Unbound TextBoxes I get no
values and if I then look at myQry1 it is always empty at
that point without any requery'ing by code.

what am I doing wrong?

VBeejit
 
G

Gary Miller

OnLoad and OnOpen are a bit early to grab data from a
record. Try the OnCurrent which fires on each individual
record being populated.


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
 
V

VBeejit

My main problem is that by the time I get to On-Current,
the Query myQry1 has in effect requeried itself & no
longer recognises the subforms Textbox and throws up an
error - invalid reference to the property-form/report -
but there is nothing except docmd.Maximise within any
procedures to cause a requery. Despite the apparant lack
of records in the Query the form ALWAYS shows the correct
data from said boud myQry1 - so i guess at what point does
access make the subform property invalid & how can i get
round it?

VBeeijit.
-----Original Message-----
OnLoad and OnOpen are a bit early to grab data from a
record. Try the OnCurrent which fires on each individual
record being populated.


--

Gary Miller
Gary Miller Computer Services
Sisters, OR
________________________
VBeejit said:
Hi,

Having read thru previous postings I am trying to use the
Dbl_Click event of a SubFrm named CDMachSubFrm, within
CustDetFrm where it is named sCDMachSubFrm, and the
TextBox within the continuos form that you Dbl click is
named txtSerNum. This should then open another form based
on myQry1 with a Criteria against matching field SerNum
worded thus:
[Forms]![CustDetFrm]![sCDMachSubFrm].[Form]![txtSerNum]

The 2nd form MCSelFrm opens & displays the data correctly
in all the bound fields, but if I try and calculate
additional totals etc. from the On_Load or On_Open event
of the form to display in Unbound TextBoxes I get no
values and if I then look at myQry1 it is always empty at
that point without any requery'ing by code.

what am I doing wrong?

VBeejit


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top