Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing Forms

Status
Not open for further replies.

khwaja

Technical User
Aug 27, 2001
431
AU
I have a data maintenance form with a sub form based on a query. Records are restricted based on a flag that I have created in the underlying query. Occassionally, when user is working on these restricted records, they need to include additional records. I have provided a command button in this data maintenance form, which allows them to open another form based on ALL records and put a tick so that new record can also be added back to their port folio. Under normal circumstances, my expectation would be that as soon as user places a tick and the receord is saved in ALL records form and user returns to the orginal form, it should have new record included. But despite my best efforts, it is not happening and user has to close the maintenance form completely and come back in to refresh.

I tried using me.refresh command in the main form as well as sub form in On Activate property but that did not work. Could someone be of help?

Cheers

Whe
 
Have you tried the DoCmd.Save then the Me.Refresh? Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Thanks for your response. No it did not work. I tried tagging the event procedure to On Acivate, One Load and On Got Focus properties but no luck. If I can figure out in what state a form is when I get back to it after closing the other form where I am putting a flag, I might be able to attach this code to the right property. Just to be clear, my form are is as under:

frm location look up Main form
frmSchedule Sub form
frmAssign Seperate form which call using a command button in the main form.

Look forward to some valuable advice.

Cheers
 
Any more insights on this?

Cheers
 
There is the Me.Requery, but I am not to sure what it is you are doing. Are you running a query then using those result as the underlying data for a form then trying to add more records to that data? IF that is the case you may want to try a different aproach and use an make table query. You would need to have a table defined with all the fields in it from the query then run your query after the query is done then when you want to add another record you would use and update query to that same table. Like I said though I am a little fuzzy on what it is you are exactly doing. Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Thanks. I have a database of supermarkets. Not all supermarkets receive refurbishment. So in order to isolate certain stores with current projects, user goes to a ‘Flag Store’ form and selects the store and flags it for the maintenance of project related data which effectively creates a portfolio of current projects to look after (filtered through a query). While in the maintenance mode, occasionally, user might like to add more stores to his portfolio. Therefore I provided an 'Flag Store' button in this data entry form, which takes users to a form showing all records and the ability to flag additional stores. Whole things works well but the only problem is when user closes the ‘Flag Store’ form after placing a tick against new stores and returns to main data entry screen, the newly flagged record does not show up until he closes the data entry form and comes back in.

I wonder if there is some code I can add to a suitable property of the data entry form to trigger a refresh or requery as soon as other form is closed and focus is back to the main form.

I hope this will facilitate your understanding of the issue.

Cheers
AK
 
OK I think I undestand now so you have a recordset open and if a user wnat to add another record a second form is opened and a record selected for the record set. when you close that second form you want the first form to be updated. Is this correct? If so then what you need to is either on the second forms OnClose_Event is address the first form to refresh. Forms!Form1.Refresh also you may be able to use the first forms gotFocus event. I cant say for sure since I am not in my win box right now. But on the Forms GotFocus_Event you would do the Me.Refresh. If this does not work maybe you can zip it and send me a copy and I can look at it.

HTH Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top