467,858 Members | 1,607 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,858 developers. It's quick & easy.

.requery with sub form

Scenary:
a main form contains two sub-form unbounded.
Sub-form "one" contains a list of products.
Sub-form "two" contains the items of the selected product.

Event:
when, from sub-form "two", it's modified type or quantity of items, I
need to execute .requery's method on sub-form "one";

Problem:
..requery's method on sub-form "one", sometimes, relists the records of
that form and changes view order; when it happened, the focus from the
selected record of sub-form "one" moves to others, and that fact make
not usable the form.

"negative" example:
sub-form "one" - inserted record "1"
sub-form "one" - inserted record "2"
sub-form "one" - inserted record "3"
sub-form "two" - modifying items
*** problem:
sub-form "one" - focus on record "2" (last position)
sub-form "one" - record 3 moved in first position


I'm not able to understand why this problem happend often and not
always, and that problem so described it's difficult to be correctly
focalized.

Some ideas about?

Bye, Gianluca

Nov 13 '05 #1
  • viewed: 1489
Share:
2 Replies
Gianluca,

You need to 'link' the two subforms. There will be no need to requery form 'one'.
Access can do this for you ...
I think you need something like the Form 'Customers and Orders' in the sample
Northwind.mdb
Check it out.

--
Hope this helps
Arno R

"Gianluca_Venezia" <te************@yahoo.it> schreef in bericht
news:11**********************@g14g2000cwa.googlegr oups.com...
Scenary:
a main form contains two sub-form unbounded.
Sub-form "one" contains a list of products.
Sub-form "two" contains the items of the selected product.

Event:
when, from sub-form "two", it's modified type or quantity of items, I
need to execute .requery's method on sub-form "one";

Problem:
.requery's method on sub-form "one", sometimes, relists the records of
that form and changes view order; when it happened, the focus from the
selected record of sub-form "one" moves to others, and that fact make
not usable the form.

"negative" example:
sub-form "one" - inserted record "1"
sub-form "one" - inserted record "2"
sub-form "one" - inserted record "3"
sub-form "two" - modifying items
*** problem:
sub-form "one" - focus on record "2" (last position)
sub-form "one" - record 3 moved in first position


I'm not able to understand why this problem happend often and not
always, and that problem so described it's difficult to be correctly
focalized.

Some ideas about?

Bye, Gianluca


Nov 13 '05 #2
thw two subform can be linked? Never Tryed... I always use to link main
form with a subform...

however, I solved so:

parent.formone.form.refresh
and run well.

thanks
Gianluca

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Michelle | last post: by
2 posts views Thread by F. Michael Miller | last post: by
14 posts views Thread by Kurt | last post: by
2 posts views Thread by Lyn | last post: by
reply views Thread by jack112 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.