简体   繁体   中英

Microsoft Access How to refresh the parent form from the subform

I know this question has been ask thousands of time, but I couldn't find a direct answer for this problem.

I am a programmer, but I never bothered learning VBA since this is only a small project I am doing on the side. I would prefer only using macro's.

I currently have a parent form inside a navigation menu, which has a datasheet table which display all the information about all the customers.

http://i.stack.imgur.com/d3TdM.png

In this parent form, I have a button to allow the user to add a new customer which opens a pop up form.

http://i.stack.imgur.com/RDSvq.png

I want the save button in this pop up form to update the parent form onClose. I know the record is working since if I switch off to a different tab and come back to it. I can see the new record added to the table.

Put this on the form frm_addNewCustomer on close event

 Private Sub Form_Close()
     [Forms]![TheFormYouWantUpdated].Refresh
 End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM