RE: Need to requery a main form with a pop up form
- From: CrazyAccessProgrammer <CrazyAccessProgrammer@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 Mar 2009 10:19:02 -0800
When you requery a form, a result of that action is the form will move to the
first record of its recordset.
Try to use refresh or repaint:
Open you're popup form where you enter your payments in dialog mode. Dialog
mode has the neat effect of halting execution of code after the openform (in
dialog mode) command until your popup form is closed.
DoCmd.OpenForm "FormName", acNormal, , , acFormEdit, acDialog
After the popup form is closed by the user, the code execution on your
parent form will continue, add the following lines after the code that opens
your popup form:
me.form.refresh: me.form.repaint
refesh updates the values of controls bound to fields.
repaint updates the value of unbound calculated controls on your form.
Depending on your needs, you may not need both refresh and repaint, so try
each one separatley by itself to see if you get the desired results.
"troy23" wrote:
I have a main form which has a balance for each record..
This form opens a pop up form where I enter payments.
When the pop up closes it should update the balance on the main form.
When I try to use requery in my code I find the main form suddenly
disappears.
I need it to update the balance and stay on the record that called the
pop up
Here is my code for the pop up. It is run from a close button and It
basically makes sure the record is the one that was called.
Dim FormName As String, SyncCriteria As String
Dim F As Form, rs As Object
FormName = "frmInvoiceMain"
Set F = Forms(FormName)
Set rs = F.RecordsetClone
SynchCriteria = "OrderID = " & Me.InvoiceID
rs.FindFirst SynchCriteria
F.Bookmark = rs.Bookmark
DoCmd.Close
- Follow-Ups:
- Re: Need to requery a main form with a pop up form
- From: troy23
- Re: Need to requery a main form with a pop up form
- From: troy23
- Re: Need to requery a main form with a pop up form
- References:
- Need to requery a main form with a pop up form
- From: troy23
- Need to requery a main form with a pop up form
- Prev by Date: Need to requery a main form with a pop up form
- Next by Date: Re: track meeting room use
- Previous by thread: Need to requery a main form with a pop up form
- Next by thread: Re: Need to requery a main form with a pop up form
- Index(es):