Subforms won't refresh after new record

  • Follow


Access 2003, XP Pro

I have a main form with two separate subforms. I view various records by 
clicking on some list boxes.

To add a new record, I select Records, Data Entry.

I then
(1) Make a selection in a combo on the main form.
(2) Make a selection in a combo and enter some text in a textbox on subform1
(3) Make a selection in a combo on subform2

Subform2 has some code on the After Update event  that  saves the new record 
and goes to a previously selected record in cbo1 on the main form (cbo2 has 
code on the After Update event to go to that record).

Here's the code on subform2
    If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
    
    Me.Parent.Requery
    Me.Parent!subform1.Form.Requery
    Me.Requery

    Me.Parent!cbo2= Me.Parent!cbo1

    Me.Parent.Refresh
    Me.Parent!subform.Form.Refresh
    Me.Refresh

The problem is the main form then displays the correct record, but the two 
subforms remain blank until I close and reopen the form.

I have also tried solutions without code just by clicking to another record, 
but then the main form once again displays the correct record, but then the 
subforms display the new data and won't refresh until I close and reopen the 
form.

Thank you

Peter

0
Reply Utf 11/17/2009 6:16:31 AM

Sorry this question is here twice. When It didn't appear in the forums after 
half an hour, I reposted. Post answers to the question immediately above.

Thanks
1
Reply Utf 11/18/2009 1:58:02 AM


Sorry--The post immediately below is the one
1
Reply Utf 11/18/2009 2:01:01 AM

Ignore this thread, I have re-posted, hopefully a little more clearly.
1
Reply Utf 11/19/2009 2:51:02 AM

3 Replies
640 Views

(page loaded in 0.104 seconds)

Similiar Articles:
















7/23/2012 9:19:52 AM


Reply: