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

button to refresh form 2

Status
Not open for further replies.

hinchdog

Programmer
Feb 14, 2001
380
US
does anyone know a way to make a button to refresh a form. this is to avoid having to close the form and re-open it. i'm very new to access so please be gentle. thanks!

-hinchdog
 
In your button's click event type:

Me.Refresh

The Refresh method immediately updates the records in the underlying record source for a specified form or datasheet to reflect changes made to the data by you and other users in a multiuser environment. (This paragraph is from the Access tutorial)

Hope this helps. lonniejohnson@kawvalley.org
 
In your button's click event type:

Me.Refresh

The Refresh method immediately updates the records in the underlying record source for a specified form or datasheet to reflect changes made to the data by you and other users in a multiuser environment. (This paragraph is from the Access tutorial)

Hope this helps. lcjohnson@kawvalley.org
 
it actually doesn't work. could this have something to do with the fact that i'm using access to call a SQL Server database using ODBC?
 
You may want to requery, then refresh:

me.requery
me.refresh Mike Rohde
rohdem@marshallengines.com
 
While your on the subject,
How would you make a command button update the tabel
(this is a data entry type form), and move on to the next empty record for the next input. I don't want any of the information saved untill the form is complete and the command button in clicked. I'm sure besides the button properties there may be some to modify in the text boxes and combo boxes I am using. It's a simple form linked to only one table?
 
The info is saved automatically when you move between records, so all your command button needs to do is advance to the next record.

DoCmd.GoToRecord , , acNewRec Mike Rohde
rohdem@marshallengines.com
 
Thank you .
That did the job and quite easily.
Guess its time to bring in that VB Book I got in school that made me not want to get into programming and opt for networking. But database is part of networking and database can include some programming. So I better get up to speed. Man, us newbies have a lot to learn.
 
Hey Racer,

I am just the opposite. I have a degree in networking, but I do not like it any where near as well as help desk work and programming/databases. I just enjoy solving problems. I am happier doing this kind of work. I have figured out that it is better to be happy and not make as much money, than to have my pockets stuffed with money and be completely stressed out and miserable. So, to every one every where, do what you enjoy. Life is too short, and way too precious.

Thanks,
Don
 
I have had a similar problem with refreshing but i cant seem to make your solution work.
I am adding a new record in a seperate popup form and then returning to the main form.
I have done a onfocus
Me.Refresh
(doesn't work)
Also tried a button
(doesn't work)

Can anyone help me solve this.

thanks
 
Hi,Damien
Can you tall me more about your problem.
what field in main form you update from another form? Fule
 
Well Fule,
I have a form that contains records for companies.
I also have a command button on this form to add a new company. When pushed this pops up and the user can fill it in and save the record, close the form.

I have got the refresh to work now on a button event on the original form. But I can't get it to work automaticly, i.e. - on the get focus.

Any ideas

Cheers
 
you could try putting in the line:-

docmd.openform "originalForm"

after the line to close the 'popup form'

within the close button 'on click' event.

although the form's already open it should update itself.
 
Thanks for your help but it doesn't seem to update using the docmd.openform from the popup. any other ideas. Can I refresh a form from another form.
I tried

FrmCompanyAdvertising.Requery
FrmCompanyAdvertising.Refresh

putting this code in the save button on the popup form but it says object required. Is there another way.
 
OK try this in the popup forms close button 'on click'.

docmd.close acform, "originalForm"
docmd.openform "originalForm"

should close & re-open in one go and refresh itself.

 
Cool,
that works, yippy. But the original form has 4 tabs. Is there a property I can set to open to the right tab?
If not thanks heaps for ur help anyway.
 
not sure if that's possible.
What actually fixed the 'refresh'. was it interval in options or just closing/re opening form ?
 
The Closing/re opening form worked. I just cant get it to open to the right tab. The refresh interval made no difference with the form open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top