[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

fresh only combo boxes on forms that are stayed open?

Posted on 2012-03-16
4
Medium Priority
?
230 Views
Last Modified: 2012-03-19
Hi,

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()?
0
Comment
Question by:dkim18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
Helen Feddema earned 2000 total points
ID: 37730650
Yes, just requery the combo boxes that need it, using syntax like this from the AfterUpdate event:

Forms![frmCustomers]![cboCity].Requery

Open in new window

0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 37730656
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
   Else
      DoCmd.OpenForm "fmnuMain"
   End If

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37730665
Modified.
0
 

Author Comment

by:dkim18
ID: 37730682
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?
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question