fresh only combo boxes on forms that are stayed open?


I have a acess 2007 database and several forms/subforms with combo boxes.
As example, I have three forms called publication, author and institution.
My users usually open all three forms to do the data entry.

The publication has a combo of authorlist.
When I don't see the author name, I go to the author form and create a new record.
After adding a new author, I ask users to click the refresh all button so the author combo box on the publication will requery it.

This refresh all makes all the opened forms to requery and lose the location of currently working location of the record.

What would be a fix for this kind of situation?
basically when I enter a new cord, I want only requery any controls that uses that table.
So I don't have to use refresh all button.

Do I look for specific combo boxes that use the table to which a newly added record went from _AfterUpdate()?
Who is Participating?
Helen FeddemaConnect With a Mentor Commented:
Yes, just requery the combo boxes that need it, using syntax like this from the AfterUpdate event:


Open in new window

Helen FeddemaCommented:
You might also need to check whether the form is open (though maybe not, if the users keep all the forms open all the time).  Here is some generic code for that:

   Dim prj As Object

   Set prj = Application.CurrentProject
   If prj.AllForms("fmnuMain").IsLoaded = True Then
      Forms![fmnuMain].Visible = True
      DoCmd.OpenForm "fmnuMain"
   End If

Open in new window

dkim18Author Commented:
The most combo boxes are in the subforms. It is bound to the subform. The control source is from the subform and row source is coming from a query.

Can't find the combo box control from the subform.

Why am I checking if forms are open or not?
So I don't requery those control not opened?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.