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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

requery form

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
0
0
GB
I have a form which lists all outstanding jobs. This form is based on a query with the criteria - date closed is null. When you click on the job number it opens another form with all the details of the job. I then close the job from this form and return to the main outstanding jobs form. However the closed job is still listed. I tried putting requery on the gotfocus event of the outstanding jobs form but that didn't do any good. Is there anyway to requery it to remove the closed jobs without closing and reopening the form?
 
How about the On Close event of the Jobs form that you are updating, rather than the Jobs listing form?
Code:
Private Sub Form_Close()
Forms![i][NameOfJobsListingForm][/i].Requery
End Sub
 
Be aware that the GotFocus event for a form only fires if that form has not controls that can receive the focus.

From Help said:
When you switch between two open forms, the Deactivate event occurs for the first form, and the Activate event occurs for the second form. If the forms contain no visible, enabled controls, the LostFocus event occurs for the first form before the Deactivate event, and the GotFocus event occurs for the second form after the Activate event.




When Galileo theorized that Aristotle's view of the Universe contained errors, he was labeled a fool.
It wasn't until he proved it that he was called dangerous.
[wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top