Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2007, 07:11 AM
Authorized User
 
Join Date: Feb 2006
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default How to refesh Data in Master Form

Hi,

i am having a problem regarding popup form and master form, and i have tried too many things but could not succeed. so i am requesting for any solutions, so thanks in advance for considering my problem

i have one Master form : frmEnrollment and one Subform on it : frmEnrollmentVsEducation

now on frmEnrollmentVsEducation, i have a combobox named : InstituteID and one "add new Institute" button near it, to allow user to add new institute if they are not in list.

when user press this button, form frmInstitute pops up in add new mode and adds new Institute Details.

problem : after adding new Institute, pop up form (frmInstitute) is closed but my parent form's Combo box (InstituteID) does not reflect that newly added record automatically.

can plz any one suggest how to refresh my parent form's combox automatically to that i do not require to add refresh button everywhere, i have too many combo boxes in my project and i am facing same problem for every combo box.

thanks for your consideration, all suggestion are welcome

ashok sharma



 
Old July 17th, 2007, 10:32 AM
Registered User
 
Join Date: Jul 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think that if you create a procedure in the GotFocus event of the master form, you could have the form refresh its data when it comes back to the front.

Something like this:

Private Sub Form_GotFocus()
DoCmd.Requery
End Sub

Have you tried that yet?

Shane
 
Old July 18th, 2007, 12:14 AM
Authorized User
 
Join Date: Feb 2006
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default

thanx shane for your reply,

i have tried this, but this have a slight problem, that this event will fire everytime my form got focus.

my problem was to refresh my list only when i add new institute with popup form.

thanx once again

ashok sharma
 
Old July 18th, 2007, 08:40 AM
Registered User
 
Join Date: Jul 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Then you could place the procedure in the (frmInstitute) Add button's onClick or MouseUp event.....?

Does the Add button close the frmInstitute form? If so, you could place the procedure in the Close event of the frmInstitute form.

Hope this helps,

Shane
 
Old July 19th, 2007, 06:35 AM
Authorized User
 
Join Date: Feb 2006
Posts: 67
Thanks: 7
Thanked 0 Times in 0 Posts
Send a message via Yahoo to beetle_jaipur
Default

Thanx NassauBob

for your suggestion, i got the solution, and the solution is to add a common function in module which checks that the parent form is opened or not, if it is opened, it requery the data in the combo box and closes the pop up form.
therefore the parent form's combo box is also synchronized with new entry

thanks again for your consideration and help

ashok sharma






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem accessing Request.Form with Master Pages kittu_asa ASP.NET 2.0 Basics 1 February 28th, 2008 09:38 AM
Problem accessing Request.Form with Master Pages niceFEPF ASP.NET 2.0 Basics 7 February 14th, 2008 04:25 PM
retriving data from master tables ali_md SQL Server 2000 0 January 31st, 2006 07:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.