Connecting Tech Pros Worldwide Help | Site Map

Refreshing Page

G25532
Guest
 
Posts: n/a
#1: Nov 13 '05
I have a form that contains a macro button which on clicking, opens a
subform over the main form. I have in the macro "Where Condition" the
following:
[QuoteNo]=[Forms]![frm_ViewQuote]![QuoteNo]

The subform has related fields as found in the main form for the selected
QuoteNo (hence the use of the above expression.
Once I have filled out the subform fields I would close the subform.
Q: I can't make the main form reflect the changes made in the subform for
the respective fields where the changes took place. I don't want to close
the main form and then go back into it... I know this works but I'm hoping a
quick refresh of the main form page or something could quickly provide the
changes as soon as the subform closes down.
thanks


King Ron
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Refreshing Page


In the subform .AfterUpdate event:

<uncompiled code>

Private MySubform.AfterUpdate()
Me.Parent.Requery
End Sub

</uncompiled code>

KingRon @ Chi

jv
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Refreshing Page


The way to do that is to open the second form in Dialog Mode and then
do a refresh on the main form once the second form is closed. I would
remove the macro and place the following code in the On_Click event
procedure of the button:

DoCmd.OpenForm "SecondFormName", , , "[QuoteNo]=" &
[Forms]![frm_ViewQuote]![QuoteNo] , , acDialog
Me.Refresh

The above code assumes that that your QuoteNo is a numeric field. If
it is a text field then change the Where parameter to "[QuoteNo]='" &
[Forms]![frm_ViewQuote]![QuoteNo] & "'"

Good luck.

Julie

jv
Guest
 
Posts: n/a
#4: Nov 13 '05

re: Refreshing Page


I also assumed that when you said subform, you meant popup form.
Otherwise you wouldn't use a macro with a Where Condidtion to open it.
Forgive me if I assumed wrong.

Closed Thread