Subform Requery

  • Thread starter gmenon100 via AccessMonster.com
  • Start date

G

gmenon100 via AccessMonster.com

I have a main form with 1 combobox (unbound). On the same form, I have a
subform (ordertotals) which has a subform (orderdetails),

The mainform and subform1 have master and child fields connected and the
subform1 and subform 2 are also connected.

Now when a value is selected from the combobox, it filters order totals in
subform 1 and order details in subform2.

Subform 1 is read only, whereas subform 2 can be edited.

My problem: When I edit any information on Subform 2, the value in the
subform 1 does not change or refresh, unless I go to the combobox and change
the selection and comeback to the original value.

Can someone please help me formulate this so that whenever a change is made
in the subform2, subform1 updates automatically.

All help is sincerely appreciated.

Thanks in advance.

gmenon
 
Ad

Advertisements

S

strive4peace

on the form AfterUpdate event of subform2

me.parent.subform1_controlname.requery

if you want to force subform2 to be saved each time a change is made so
subform1 is updated, you can put this on the AfterUpdate event of each
control:

me.dirty = false

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
G

gmenon100 via AccessMonster.com

Hi Crystal,

I tried this code but was unable to make it work:

I get the following error: Runtime error '2465' Application defined or object-
defined error.

This is how I used the code.

Me.Parent.SubmissionTotals1_PMTSTATUS.Requery.

Where SubmissionTotals1 is the subform1 and PMTSTATUS is one of the control
name on the subform.

the subform 2 is named as Browse All Submissions (which is a detailed version
of form SubmissionTotals1)

Can you please advice??

Thank you.

Gmenon

on the form AfterUpdate event of subform2

me.parent.subform1_controlname.requery

if you want to force subform2 to be saved each time a change is made so
subform1 is updated, you can put this on the AfterUpdate event of each
control:

me.dirty = false

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
I have a main form with 1 combobox (unbound). On the same form, I have a
subform (ordertotals) which has a subform (orderdetails),
[quoted text clipped - 19 lines]
 
S

strive4peace

where is the code... behind another subform?

if so, you need this:

Me.Parent.SubmissionTotals1.form.PMTSTATUS.Requery

for reference (and this is from a main form --> .Parent of your example) -->

Me.Form(strFoundItemsForm) is the subform control -- its height, width,
SourceObject, etc

Me.Form(strFoundItemsForm).Form is the form inside the subform control
-- and that is where your records and controls are...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Hi Crystal,

I tried this code but was unable to make it work:

I get the following error: Runtime error '2465' Application defined or object-
defined error.

This is how I used the code.

Me.Parent.SubmissionTotals1_PMTSTATUS.Requery.

Where SubmissionTotals1 is the subform1 and PMTSTATUS is one of the control
name on the subform.

the subform 2 is named as Browse All Submissions (which is a detailed version
of form SubmissionTotals1)

Can you please advice??

Thank you.

Gmenon

on the form AfterUpdate event of subform2

me.parent.subform1_controlname.requery

if you want to force subform2 to be saved each time a change is made so
subform1 is updated, you can put this on the AfterUpdate event of each
control:

me.dirty = false

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
I have a main form with 1 combobox (unbound). On the same form, I have a
subform (ordertotals) which has a subform (orderdetails),
[quoted text clipped - 19 lines]
 
G

gmenon100 via AccessMonster.com

Thanks Crystal,

I am still unable to get it working.

I cant figure out what is missing, i used the code given by you:

Me.Parent.SubmissionTotals1.form.PMTSTATUS.Requery

on the subform2 (browsesubmissionssubform) after update, however I still get
the same Runtime error 2465 application.

My form stucture is as under:

Main Form: DocumentStaus
has a unbound combobox: control name : [stats] having record source:
"DOCSTATUS"

SubForm1: submissionTotals1

is a read only single form which is based on a query [Submission Totals]
(Grouped and summed)

Subform2: BrowseSubmissionssubform

is a subform of SubmissionTotals1, which can be edited. I
want all edit on this subform2 to reflect on the subform1.

I am not sure what I am missing. My computer can be accessed by GoToMy PC, if
you need to see it.

Please help. I am just a novice, trying to work out of this situation.

Thanks for your help.
where is the code... behind another subform?

if so, you need this:

Me.Parent.SubmissionTotals1.form.PMTSTATUS.Requery

for reference (and this is from a main form --> .Parent of your example) -->

Me.Form(strFoundItemsForm) is the subform control -- its height, width,
SourceObject, etc

Me.Form(strFoundItemsForm).Form is the form inside the subform control
-- and that is where your records and controls are...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
Hi Crystal,
[quoted text clipped - 43 lines]
[quoted text clipped - 19 lines]
gmenon
 
Ad

Advertisements

S

strive4peace

email me -- we can set up a time for you to call me and we can connect
and I can see what is going on.

btw, LogMeIn.com does the same thing as GoToMyPc and is free...

when you email me, please tell me your name...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*


Thanks Crystal,

I am still unable to get it working.

I cant figure out what is missing, i used the code given by you:

Me.Parent.SubmissionTotals1.form.PMTSTATUS.Requery

on the subform2 (browsesubmissionssubform) after update, however I still get
the same Runtime error 2465 application.

My form stucture is as under:

Main Form: DocumentStaus
has a unbound combobox: control name : [stats] having record source:
"DOCSTATUS"

SubForm1: submissionTotals1

is a read only single form which is based on a query [Submission Totals]
(Grouped and summed)

Subform2: BrowseSubmissionssubform

is a subform of SubmissionTotals1, which can be edited. I
want all edit on this subform2 to reflect on the subform1.

I am not sure what I am missing. My computer can be accessed by GoToMy PC, if
you need to see it.

Please help. I am just a novice, trying to work out of this situation.

Thanks for your help.
where is the code... behind another subform?

if so, you need this:

Me.Parent.SubmissionTotals1.form.PMTSTATUS.Requery

for reference (and this is from a main form --> .Parent of your example) -->

Me.Form(strFoundItemsForm) is the subform control -- its height, width,
SourceObject, etc

Me.Form(strFoundItemsForm).Form is the form inside the subform control
-- and that is where your records and controls are...

Warm Regards,
Crystal
*
:) have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
Hi Crystal,
[quoted text clipped - 43 lines]
[quoted text clipped - 19 lines]
gmenon
 
Ad

Advertisements


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

Similar Threads


Top