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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh form, code "Shift+F9" or better route?

Status
Not open for further replies.

Scoob55k

Technical User
Nov 16, 2005
62
US
This should be a snap for someone out there. I am using a combo box in a form to lookup data I need retrieved. Thing is, right now after selecting the qualifying data in the combo box, you have to press "Shift + F9" to get it to update the rest of the form. Best way would be to code an AfterUpdate command I feel. Thanks!

 
Have a look at the Recalc method of the form object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
The recalc method states that it is the equivilent of the F9 key being pressed. I couldn't get it to work. I need the SHIFT + F9. I've also tried Me.Refresh on both the control (combo box) and the form AfterUpdate, On Change, etc., etc. with no success.

The form record source is a select query of which gets it's parameter from the forms combo box of which I placed in the form header because the initial form opening (which takes a few seconds and seems slow. Due to the query for the data in the combo box I believe) displays a blank Detail section of which the combo box will not be displayed either. After selecting an item in the combo box and pressing SHIFT + F9, everything works pretty quick and well. Is there a better way?

Appreciate your help though. Thanks!
 
Sorry, I don't know what Shift+F9 is supposed to do.
 
It refreshes the form. I saw it in the help section in Access 2003. Search "Refresh or requery data" and view the item under the same name. That is where I got it from after I couldn't get the Me.Refresh to work.

One of the items is suggested: "To refresh the records in Datasheet or Form view, click Refresh on the Records menu." looked good to me as I thought I would right code to use a menu command, but I couldn't find it on my toolbars. Also, would it be a command all users could use regardless of what toolbars or settings they had. A lot of folks use this database to look up information.

Thanks again!
 
The form's Requery method should be equivalent to shift+F9.

If this does not work you could try the following work-around:
docmd.Sendkeys "+{F9}"
 
p.s. I only have experience with Access 97. I'm assuming the requery method works the same in Access 2003, but I can't say for sure.
 
Thanks so much!! The Me.Requery on the combo AfterUpdate, not the form worked!

I'm such and idiot. I was checking out the Requery method before I posted this, but was close to my wits end and what Help had to say about Requery, I wasn't sure about and......

Aww man, I appreciate all of yours help, but you know how it is, you get more satifaction out of figuring it out yourself. In reality I would have rather been way off, not so close. Have a great Easter!! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top