Can I make a linked for update with On Current

P

plh

Hello Access Gurus
Similar to the way the data on a subform updates when you go from record to
record, is there a way to have a popup linked form remain open and have the data
update, perhaps using the OnCurrent property, as the user moves from record to
record on the main form?
Thanks Very Much,
-plh
 
T

tina

yes. the easiest way that i can think of is to base the pop-up form on a
query or SQL statement, and include criteria on the foreign key field that
refers back to the primary key field of the main form, as

Forms!MainFormName!PrimaryKeyFieldName

then add code to (you guessed it) the main form's Current event procedure,
to requery the pop-up form's RecordSource, as

Forms!PopupFormName.Requery

hth
 
P

plh

tina,
Thanks for all your help. I could look, but I am not going to, because the word
from upstairs is that my stopgap measure -- closing the pop-up and making the
user reopen it as needed after changing records -- is just fine, so that is one
less thing for me to have to fiddle with. Again, thanks for your help.
-plh

tina said:
do you have anything else running in the pop-up form, like a filter?


plh said:
Hello tina,
Thank you for your reply. Unfortunately, it did not work.
In the design view of the query used by the pop-up I have:

[Forms]![frmCustOrds]![ID] (in the "Criteria:" row)

and in the OnCurrent sub in the main form I have:

Forms!frmMEHours4PaulF.Requery

Moving to another record on the main form causes the pop-up to come up blank.
When I close and re-open the pop-up the proper data appears.
Thank You,
-plh

tina said:
yes. the easiest way that i can think of is to base the pop-up form on a
query or SQL statement, and include criteria on the foreign key field that
refers back to the primary key field of the main form, as

Forms!MainFormName!PrimaryKeyFieldName

then add code to (you guessed it) the main form's Current event procedure,
to requery the pop-up form's RecordSource, as

Forms!PopupFormName.Requery

hth


Hello Access Gurus
Similar to the way the data on a subform updates when you go from record
to
record, is there a way to have a popup linked form remain open and have
the data
update, perhaps using the OnCurrent property, as the user moves from
record to
record on the main form?
Thanks Very Much,
-plh
 
T

tina

you're welcome :)


plh said:
tina,
Thanks for all your help. I could look, but I am not going to, because the word
from upstairs is that my stopgap measure -- closing the pop-up and making the
user reopen it as needed after changing records -- is just fine, so that is one
less thing for me to have to fiddle with. Again, thanks for your help.
-plh

says...
do you have anything else running in the pop-up form, like a filter?


plh said:
Hello tina,
Thank you for your reply. Unfortunately, it did not work.
In the design view of the query used by the pop-up I have:

[Forms]![frmCustOrds]![ID] (in the "Criteria:" row)

and in the OnCurrent sub in the main form I have:

Forms!frmMEHours4PaulF.Requery

Moving to another record on the main form causes the pop-up to come up blank.
When I close and re-open the pop-up the proper data appears.
Thank You,
-plh
 
Top