473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Refresh on Close

I guess this is a simple one but I can't seem to get it to work. I want to
refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I update
the data on that from, I want it to automatically refresh the details which
are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.

Apr 28 '06 #1
6 6973
Hi, Scott.

It sounds like you want to requery the other form, not refresh it.
Requerying a form means that the form retrieves all records from the
database that are part of its Record Source. That includes new records,
updates and deletions.

Refreshing only refreshes the data set that the form retrieved from the
database when it was first opened or when the form was last requeried. It
won't reflect updates to the data that were carried out by other users or
other processes, such as your other form.
I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
That's VBA 4.0, which was deprecated a long time ago. You don't want to use
that. Use the current VBA version for your application, which is VBA 6.x,
unless you're using Access 97. Access 97 uses VBA 5.0.
On Close I want it to update the form frmMainMenu
To requery the other form, try:

Forms("frmMainMenu").Requery
DoCmd.Close acForm, Me.Name

To refresh the other form, try:

Forms("frmMainMenu").Refresh
DoCmd.Close acForm, Me.Name

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...I guess this is a simple one but I can't seem to get it to work. I want to
refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I update
the data on that from, I want it to automatically refresh the details
which are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.

Apr 28 '06 #2
forms!frmMainMenu.refresh
docmd.close acform, me.name

(Good to specify the name of the form to close to avoid problems, especially
if the focus might get shifted to the other form by the refresh command.)
hope this helps
-John
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
I guess this is a simple one but I can't seem to get it to work. I want to
refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I update
the data on that from, I want it to automatically refresh the details
which are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.

Apr 28 '06 #3
Thanks for the info. Either of the two scenarios you sent work. The only
thing is it doesn't clost the open form. Main Menu requeries, but the form
"frmRepDetails" stays open and I get an error message "Method or Data not
found.

I replaced "Me.Name" with Me.frmRepDetails" thinking it would close the
form.

Sorry, am very much a novice but appreciate your help.

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AM> wrote in
message news:yZ******************************@adelphia.com ...
Hi, Scott.

It sounds like you want to requery the other form, not refresh it.
Requerying a form means that the form retrieves all records from the
database that are part of its Record Source. That includes new records,
updates and deletions.

Refreshing only refreshes the data set that the form retrieved from the
database when it was first opened or when the form was last requeried. It
won't reflect updates to the data that were carried out by other users or
other processes, such as your other form.
I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70


That's VBA 4.0, which was deprecated a long time ago. You don't want to
use that. Use the current VBA version for your application, which is VBA
6.x, unless you're using Access 97. Access 97 uses VBA 5.0.
On Close I want it to update the form frmMainMenu


To requery the other form, try:

Forms("frmMainMenu").Requery
DoCmd.Close acForm, Me.Name

To refresh the other form, try:

Forms("frmMainMenu").Refresh
DoCmd.Close acForm, Me.Name

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
I guess this is a simple one but I can't seem to get it to work. I want to
refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I update
the data on that from, I want it to automatically refresh the details
which are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.


Apr 28 '06 #4
All good. Got it working!

Thanks guys for your time :o)

"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
Thanks for the info. Either of the two scenarios you sent work. The only
thing is it doesn't clost the open form. Main Menu requeries, but the form
"frmRepDetails" stays open and I get an error message "Method or Data not
found.

I replaced "Me.Name" with Me.frmRepDetails" thinking it would close the
form.

Sorry, am very much a novice but appreciate your help.

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AM> wrote
in message news:yZ******************************@adelphia.com ...
Hi, Scott.

It sounds like you want to requery the other form, not refresh it.
Requerying a form means that the form retrieves all records from the
database that are part of its Record Source. That includes new records,
updates and deletions.

Refreshing only refreshes the data set that the form retrieved from the
database when it was first opened or when the form was last requeried.
It won't reflect updates to the data that were carried out by other users
or other processes, such as your other form.
I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70


That's VBA 4.0, which was deprecated a long time ago. You don't want to
use that. Use the current VBA version for your application, which is VBA
6.x, unless you're using Access 97. Access 97 uses VBA 5.0.
On Close I want it to update the form frmMainMenu


To requery the other form, try:

Forms("frmMainMenu").Requery
DoCmd.Close acForm, Me.Name

To refresh the other form, try:

Forms("frmMainMenu").Refresh
DoCmd.Close acForm, Me.Name

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
I guess this is a simple one but I can't seem to get it to work. I want
to refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I
update the data on that from, I want it to automatically refresh the
details which are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.



Apr 28 '06 #5
You're welcome! Glad it helped.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
All good. Got it working!

Thanks guys for your time :o)

"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
Thanks for the info. Either of the two scenarios you sent work. The only
thing is it doesn't clost the open form. Main Menu requeries, but the
form "frmRepDetails" stays open and I get an error message "Method or
Data not found.

I replaced "Me.Name" with Me.frmRepDetails" thinking it would close the
form.

Sorry, am very much a novice but appreciate your help.

"'69 Camaro" <Fo**************************@Spameater.orgZERO_SP AM> wrote
in message news:yZ******************************@adelphia.com ...
Hi, Scott.

It sounds like you want to requery the other form, not refresh it.
Requerying a form means that the form retrieves all records from the
database that are part of its Record Source. That includes new records,
updates and deletions.

Refreshing only refreshes the data set that the form retrieved from the
database when it was first opened or when the form was last requeried.
It won't reflect updates to the data that were carried out by other
users or other processes, such as your other form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

That's VBA 4.0, which was deprecated a long time ago. You don't want to
use that. Use the current VBA version for your application, which is
VBA 6.x, unless you're using Access 97. Access 97 uses VBA 5.0.

On Close I want it to update the form frmMainMenu

To requery the other form, try:

Forms("frmMainMenu").Requery
DoCmd.Close acForm, Me.Name

To refresh the other form, try:

Forms("frmMainMenu").Refresh
DoCmd.Close acForm, Me.Name

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and
tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"scott" <sc**********@maneyacts.com> wrote in message
news:44***********************@per-qv1-newsreader-01.iinet.net.au...
I guess this is a simple one but I can't seem to get it to work. I want
to refresh an open form "onClose" of another.

I have a Close button on a form which has User Details on it. If I
update the data on that from, I want it to automatically refresh the
details which are shown on an open form.

I was going to use the default access code

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close

On Close I want it to update the form frmMainMenu

Can someone help me?

Thanks in advance.




Apr 28 '06 #6
scott wrote:
Thanks for the info. Either of the two scenarios you sent work. The only
thing is it doesn't clost the open form. Main Menu requeries, but the form
"frmRepDetails" stays open and I get an error message "Method or Data not
found.

I replaced "Me.Name" with Me.frmRepDetails" thinking it would close the
form.

Sorry, am very much a novice but appreciate your help.


Sometimes it's best to close a form Explicitly. Here's probably what
you have/had
Docmd.Close

You could do this instead
Docmd.Close acForm, Me.Name
Apr 28 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
3
by: J P Singh | last post by:
Hi Guys Wonder if someone can help me with this. I have a form where a user clicks a button which gives them a pop up windows to allow them to add the data. The user adds the data and click...
3
by: Danny | last post by:
HI How can I refresh the main project window in code in ms access 2000 For example, I create a new table, but when I minimize the form, the table is not there until I do F5 (refresh). I do...
1
by: hqdtech | last post by:
how to refresh webform from other webform I have 2 webform, i want if webform A was close then webform B wil refresh. And the problem second: how to catch packet on the network in C#. ...
2
by: Peter Oliphant | last post by:
I now have graphics being drawn in the Paint event of my form (yeah, and it's very cool). Problem was that it only updated any changes to these graphics when Paint was called. So, I then made it...
2
by: John Seelig | last post by:
I have a vb.net program that calls an msi to uninstall a control panel (*.cpi, *.cpl and *.exe). However, after uninstall the icon persists in the control panel window until a refresh (F5) is...
4
by: Scott | last post by:
I'm trying to get access to open, refresh and then close an excel spreadsheet for me. Below is the code I'm using to open and close Excel, I just can't get it to refresh my data linked back to my...
5
by: BlackBox | last post by:
I have a Listbox1 in the main form and I can add listbox1 items in the parent form. But when I close the parent form Listbox1 in the main form does not get refresh. I need to re-open the app. ...
16
Knut Ole
by: Knut Ole | last post by:
I have a function to draw some shapes on a form depending on values in queries/tables. The whole procedure takes up to ten seconds however, and as I'm new to coding, I assume I might have a lot to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.