A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Requer/Refresh Issue



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2008, 08:41 AM posted to microsoft.public.access.forms
rm
external usenet poster
 
Posts: 12
Default Requer/Refresh Issue

Greeting from Iraq

I have a main form (frmDO) with a subForm (frmDODetail) where the sub
control name is sfrmDODetail. The subform is a datasheet.

When I double click on sfrmDODetail and edit form is displayed
(frmEditDODetail).


When I save the changes in the edit form (frmEditDODetail) I want the
sub form (sfrmDODetail - frmDODetail) to display the edits/changes/
additions made by the user.


I have tried numerous different ways (many suggested in this group)
to
make the sub form (sfrmDODetail - frmDODetail) requery. I have tried
Forms! etc, Dim frm as FORM_frmDODetail. I have spent 4 - 5 hours
trying every different combination. At one point I had a variation of
Forms! working. Then out of the blue the method no longer worked.

Please Help
  #2  
Old April 29th, 2008, 12:09 PM posted to microsoft.public.access.forms
strive4peace
external usenet poster
 
Posts: 1,670
Default Requer/Refresh Issue

the trick is to requery the subform when you close the edit form. Use
the edit form CLOSE event

forms!mainform!subform_controlname.requery
DoEvents

WHERE
mainform is the name of the main form
subform_controlname is the Name property of the subform control

Also, before you open the edit form, make sure you save the current
record if it is 'dirty' (needs to be saved)

if me.dirty then me.dirty = false

Alternately, you can open the form with the dialog parameter and then
requery the control in the same code that opens the edit form

assuming you are specifying a WHERE parameter as well:
DoCmd.OpenForm "Formname", , , "[somefield]='something'", , acDialog

or, if you do not have a WHERE parameter
DoCmd.OpenForm "Formname", , , , , acDialog


~~~ DoEvents ~~~

DoEvents is used to make VBA pay attention to what is currently
happening and look to see if the OS (Operating System) has any requests
-- including the keyboard

ie: if you have a loop and want to be able to BREAK it with CTRL-BREAK,
put DoEvents into the loop

DoEvents will also update values written to a form by a general
procedure or code behind another form or report

A DoEvents is done when you use MsgBox, or are stepping through code
(since it has to pay attention to the keyboard)

It is a good way to say, "Wake Up!"



Warm Regards,
Crystal

Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm

*
(: have an awesome day
*



rm wrote:
Greeting from Iraq

I have a main form (frmDO) with a subForm (frmDODetail) where the sub
control name is sfrmDODetail. The subform is a datasheet.

When I double click on sfrmDODetail and edit form is displayed
(frmEditDODetail).


When I save the changes in the edit form (frmEditDODetail) I want the
sub form (sfrmDODetail - frmDODetail) to display the edits/changes/
additions made by the user.


I have tried numerous different ways (many suggested in this group)
to
make the sub form (sfrmDODetail - frmDODetail) requery. I have tried
Forms! etc, Dim frm as FORM_frmDODetail. I have spent 4 - 5 hours
trying every different combination. At one point I had a variation of
Forms! working. Then out of the blue the method no longer worked.

Please Help

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:23 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.