UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Arrrrrrghh! Subform Wont Update When Adding New Record!, Any Version    
 
   
hullstorage
post Nov 6 2011, 06:42 PM
Post #1

UtterAccess Addict
Posts: 251



Hi all,
I have attached a sample database to try and show what i mean!!

I have a form with a subform, when i click one of the records on the subform this open another extended form from a query that shows the full details of the record.

When the form opens i can change or add details to the record then when i close this form it requery the subform showing the changes. if any i have made.

Problem is, if a create a new record for the subform using the extended for it will not requery!! even when i save the record using a button.

I have to close the form that contains the subform and re-open it every time to show the new record??

Any ideas where i am going wrong

here are some of the codes i am using

THIS IS USED WHEN I CLICK ON THE RECORD OF THE SUBFORM
Private Sub DeliveryID_Click()
DoCmd.OpenForm "FrmViewExtendedDetails"
End Sub

THIS IS USED IN THE QUERY FOR THE EXTENDED FORM
[Forms]![FrmInvoice]![tblDeliveries subform]![deliveryid]

I USE THIS IF WHEN THE EXTENDED FORM IS OPENED WHICH ADDS THE INVOICE NUMBER FROM THE MAIN FORM
Private Sub Form_Open(Cancel As Integer)
If IsNull([InvoiceID]) Then
DoCmd.GoToRecord , , acNewRec

Me.InvoiceID = Forms!FrmInvoice!InvoiceID

End If


End Sub


THIS IS WHAT I USE WHEN CLOSING THE EXTENDED FORM TO REQUERY THE SUBFORM
Private Sub Form_Close()
If Not Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
[Forms]![FrmInvoice]![tblDeliveries subform]![DeliveryID].Requery



End If


End Sub


you may be best looking at the attached database and open the frminvoice form if you do not know what i mean

MANY THANKS
Attached File(s)
Attached File  Database1.zip ( 211.93K ) Number of downloads: 5
 
Go to the top of the page
 
+
dustmopheadmop
post Nov 7 2011, 12:12 AM
Post #2

UtterAccess Member
Posts: 46



Hi,
Your db can't be open, Please re upload it.
Go to the top of the page
 
+
hullstorage
post Nov 7 2011, 02:05 AM
Post #3

UtterAccess Addict
Posts: 251



I have changed database to access 2003


Attached File(s)
Attached File  Database1_UtterAccess.zip ( 45.79K ) Number of downloads: 2
 
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 04:18 PM