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

Refreshing MS Access Data

Status
Not open for further replies.

chippyles

Technical User
Nov 10, 2004
49
0
0
US
I have a button on a form that I want the user to be able to refresh the data, but I can not get it to work.

This is the code I am using. When I click the button nothing happens. What is the code that I should be using?

DoCmd.RunCommand acCmdRefresh
 
The line you should use is:

Me.Requery

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
the button is on the form header and the data that needs to be requeried is in the details. I did what you said to do and it didn't work.
 
I'll need a little more info about what isn't working then. What data has changed and why should the form data be different?

Me.Requery is designed to requery the source of the form you are currently in, which should refresh all the data.

I am what I am based on the decisions I have made.

DoubleD [bigcheeks]
 
Try also using Me.Repaint after Me.Requery

John Borges
 
In the details of the form the data comes from test query (there are the two fields Vendor and Heat with your criteria of 'Like nz([forms].[fQA_Raw_Materials].[Vendor] and .[Heat]'.

In the form header are two combo boxes with a refresh button (me.requery) on the side.

I can select the data I want for the whichever combo box I prefer (thanks for the tip on the other question).

When I press the button it does not refresh the data after I change the selection in the combo box, but if I hit 'shift F9' my data gets updated.

 
Me![subform control name].Form.Requery (or Refresh)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Repaint did not work either.

I did try the Me![subform control name].Form.Requery, but the details section of the form is not a subform. It is called detail. I plugged detail in the [] section and I am getting an error. What do you suggest I do?

 
Oops, my bad. Sorry, I missread the original post.
Have you tried Me.Refresh ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top