We help IT Professionals succeed at work.

Updating an open Subform with VBA

Sdeam asked
Medium Priority
Last Modified: 2008-02-26
 I have a rather complex form which details information about a job.  The form has a subform which has multiple line items on it.  However there is also another form which is linked to each line of the subform.  The form and table relationships are as follos

  Main --- 1 to many --- Sub --- 1 to many --- details

    Sub s1
         Detail d1

  The detail form is simply a checklist of information with two fields ItemName (text) and Finished(checkbox).  The information on the detail form is sequential in the order that it will occur/ be checked off.  

  What I want to do is to update the line item that is on the subform related to the detail form.  When an item on the detail form is checked off I want a field on the subform to update to show the next item on the checklist.  
   What I have tried to do so far is to open a recordset to the correct information that would be shown in the subform, change the information in the recordset, and then requery the suform.  When I do this I get a message saying that I need to save the current field.  I have tried inserting the command to save but it does not seem to make a difference.  If I update the recordset without trying to do a requery the information will be correct but not showing.  The field will update when I leave the current record butI will get a notice of a write conflict and be prompted to save.  I would like to be able to update the information on the subform and show the updated information immedietely when it changes.
Watch Question

Hi Sdeam,

Did you try requering the subform after the UnCheck was made?

In the CheckBox's AfterUpdate Event, place code like the following:


Hope this helps,



 I have tried to do the requery but I get an error saying that I need to save the current field.
Hi Sdeam,

Make sure that you requery at the AfterUpdate event and not in the BeforeUpdate event...

Hi SBeam,

Any progress???


You have several open questions:


To assist you in your cleanup, I'm providing the following guidelines:

1.  Stay active in your questions and provide feedback whenever possible. Likewise, when feedback has not been provided by the experts, commenting again makes them receive an email notification, and they may provide you with further information. Experts have no other method of searching for questions in which they have commented, except manually.

2.  Award points by hitting the Accept Comment As Answer button located above and to the left of that expert's comment.

3.  When grading, be sure to read:
to ensure that you understand the grading system here at EE. If you grade less than an A, you must explain why.

4.  Questions that were not helpful to you should be PAQ'd (stored in the database for their valuable content?even if not valuable to you) or deleted. To PAQ or delete a question, you must first post your intent in that question to make the experts aware. Then, if no experts object after three full days, you can post a zero-point question at community support to request deletion or PAQ. Please include the link(s) to the question(s).
CS:  http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
At that point, a moderator can refund your points and PAQ or delete the question for you. The delete button does not work.

5.  If you fail to respond to this cleanup request, I must report you to the Community Support Administrator for further action.

Our intent is to get the questions cleaned up, and not to embarrass or shame anyone. If you have any questions or need further assistance at all, feel free to ask me in this question or post a zero-point question at CS. We are very happy to help you in this task!

community support moderator

sdeam: Please read #3 again!

community support moderator

Explore More ContentExplore courses, solutions, and other research materials related to this topic.