Re: Subform Requery Doesn't Show Updates to Data
- From: Len-DSInc <LenDSInc@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 Feb 2008 07:07:01 -0800
March,
Thanks again for your help, I figured out the problem.
I developed this system so long ago in Access 97 I forgot that I setup the
main for a little unorthodox. I did not bind the main form to a query and I
kept the recordsource propery blank. Since it was an HR system, I didn't
want folks to see records they were supposed to, so I chose not to bind the
form until after they logged in. I kept the main form unbound until the user
selected an option, then I programatically bound the form to a query
recordsource based on their selection.
Looks like Access 97 handled the "late-binding" better than Access 2003. I
just made the change, and bound the main form to a query and sure enough I do
not have the problem with the subform that I was experiencing.
Thanks again for all of your help!! It is greatly appreciated. I was
trying to figure this one out for about a week.
Len
"Marshall Barton" wrote:
Len-DSInc wrote:.
Thanks for quick the reply, I tried all of those suggestions, still not
working. Here's the code that I have in the Save and Close commands of my
popup:
Private Sub cmdSave_Click()
Me.Dirty = False
DoCmd.RunCommand acCmdSaveRecord
DBEngine.Idle dbRefreshCache
DoEvents
Me.Requery
Forms![frmemployee_main]![subfrmDayOffVacation].Form.Requery
End Sub
Private Sub cmdClose_Click()
If Me.Dirty Then Me.Dirty = False
DBEngine.Idle dbRefreshCache
DoEvents
Forms![frmemployee_main]![subfrmDayOffVacation].Form.Requery
Is it possible I'm running into a record locking problem since the subform
and the popup are pointing to the same records? I didn't think so since I do
not allow edits or record selectors in the subform. Thanks,
Get rid of the DoCmd.RunCommand acCmdSaveRecord line.
Dirty = False
does the same thing, but is better because you can be sure
which form's record is being saved.
Get rid of the Me.Requery line. I can not see any point to
requerying the popup form.
About the only other idea I have about the delay is maybe
subfrmDayOffVacation is not getting enough time to display
it's records. Maybe adding this after the Requery will
jiggle things into place:
DoEvents
Forms![frmemployee_main]![subfrmDayOffVacation].Form.Repaint
DoEvents
If you do get rid of the delay, be sure to go back and
remove the various things we're trying one at a time to
determine which one, or combination, is effective. You
don't want any useless code that may be consuming resources.
One other stray thought. The delay may be caused by the
subfrmDayOffVacation form's record source returning a large
number of records. If that's the case, try filtering the
query to the minimum number of necessary records.
--
Marsh
MVP [MS Access]
- References:
- Subform Requery Doesn't Show Updates to Data
- From: Len-DSInc
- Re: Subform Requery Doesn't Show Updates to Data
- From: Marshall Barton
- Re: Subform Requery Doesn't Show Updates to Data
- From: Len-DSInc
- Re: Subform Requery Doesn't Show Updates to Data
- From: Marshall Barton
- Subform Requery Doesn't Show Updates to Data
- Prev by Date: Re: Identifying Duplicate Records
- Next by Date: Re: Identifying Duplicate Records
- Previous by thread: Re: Subform Requery Doesn't Show Updates to Data
- Next by thread: Re: Question:Text box on report
- Index(es):
Relevant Pages
|