Re: Requery Not Working
- From: sandpking@xxxxxxxxx
- Date: Wed, 16 Apr 2008 15:17:31 -0700 (PDT)
That closed the main menu too. I wanted the main menu to stay open,
but have a field on it update.
On Apr 16, 11:24 am, Klatuu <Kla...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
The Requery is working. You have your order of actions upside down. You
need to save the record before you requery the form. The refresh is
unnecessary. Try this version:
On Error GoTo Err_CloseImportForm_Click
If Me.Dirty Then
Me.Dirty = False
If CurrentProject.AllForms("Frm_Main_Menu").IsLoaded Then
Forms![Frm_Main_Menu].Requery
End If
End If
DoCmd.Close acForm, Me.Name, acSaveNo
This will only requery the form If the record was added to the table.
--
Dave Hargis, Microsoft Access MVP
"sandpk...@xxxxxxxxx" wrote:
From the main menu, I have a Max query that displays the most recent
date of a particular field. When I go into a form off of the main
menu and update that field, I'd like the main menu to be updated. The
code below does not work. Any help is appreciated.
Private Sub Command15_Click()
Dim frm As Form
On Error GoTo Err_CloseImportForm_Click
If CurrentProject.AllForms("Frm_Main_Menu").IsLoaded Then
Set frm = Forms![Frm_Main_Menu]
frm.Requery
frm.Refresh
Set frm = Nothing
End If
If Me.Dirty Then Me.Dirty = False
DoCmd.Close
Exit_CloseImportForm_Click:
Exit Sub
Err_CloseImportForm_Click:
MsgBox Err.Description
Resume Exit_CloseImportForm_Click
End Sub- Hide quoted text -
- Show quoted text -
.
- Follow-Ups:
- Re: Requery Not Working
- From: Klatuu
- Re: Requery Not Working
- From: sandpking
- Re: Requery Not Working
- References:
- Requery Not Working
- From: sandpking
- RE: Requery Not Working
- From: Klatuu
- Requery Not Working
- Prev by Date: Re: Query null question
- Next by Date: RE: General question on an event
- Previous by thread: RE: Requery Not Working
- Next by thread: Re: Requery Not Working
- Index(es):
Relevant Pages
|