Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Requery SubForm After Update

Status
Not open for further replies.

gall3on

Technical User
Mar 15, 2007
35
US
I have a main form display which contains a subform list of projects that have a field that needs to be corrected. How can I automatically requery that subform after a user updates a project with the needed correction? Right now, my main form can take care of this by using a main form Refresh button.
 
How are ya gall3on . . .

Why a Requery? Can't you just save normally?

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
I'm not sure what you mean by saving normally. Essentially I have a 'Save' button on a ProjectDetails form. What I want to happen is whenever this Save action is done, another form (which is essentially a Home form) with a subform will get updated (using a requery) automatically as a 'consequence'.

My VB sub looks like this:

On Error Resume Next
If (Form.Dirty) Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Requery "Projects_NoLeads"
End If
DoCmd.Requery "Home"

 
Hm, nevermind. I figured it out. I replaced " DoCmd.Requery "Projects_NoLeads"" with

Forms![Home]![Projects_NoLeads].Form.Requery

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top