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  

Form Refresh Question???



 
 
Thread Tools Display Modes
  #1  
Old October 6th, 2004, 03:08 AM
Dave Elliott
external usenet poster
 
Posts: n/a
Default Form Refresh Question???

Does the record have to be saved before a form refresh can be done?
Example; I have a main form and on it are sub-forms.
On the main form is a Vendor form and sometimes while the main form is open,
(before saving) I have to add a vendor via another form (Vendors) and then
need to
refresh the sub-form on the main form so it will see the new vendor.
(Me.Refresh) on double click.
My question is, do I need to add code to save the record before the refresh?



  #2  
Old October 6th, 2004, 03:14 AM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default

"Dave Elliott" wrote in message
...


My question is, do I need to add code to save the record before the
refresh?



I don't think in your case you do, but then again, ANY time I leave a "main"
form with sub-forms, I generally force a disk write.

That way, if you have a lot of forms open, and the pc freezes etc, then no,
or little data is lost.

Also you mention that you go and open the vendor form. If the current form
(main part) does not ref, or use any data/values from the vendors, then once
again you don't really need to force a disk write.

So, right before you launch the vendors form (via some nice handy
button..right??), you go:

me.Refresh ' this forces a disk write
docmd.OpenForm "vendors"

I also assume that vendors is set as "model"...so that the user MUST return
to form vendors after being done...

And, on return, you can either have the "vendors" form re-query the
sub-form, or you can use the forms on-activate event that fires when you
return back to the form. To. "re-load", and -re-query any new records for
the sub-form, you go:


me.MySubForm.Requery


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

http://www.attcanada.net/~kallal.msn


  #3  
Old October 6th, 2004, 07:29 PM
Tom Ross
external usenet poster
 
Posts: n/a
Default

You could also write the newvender code into the appropriate control on your
main form before closing it. (assuming that is why you are adding a vender
at this time). Put something like this in the new vender form close
button. NewPOrder is my main form.

If Me.Dirty Then Me.Dirty = False
Form_NewPOrder.cmbVenderID = Me.VenderID
docmd.close

Then after returning to the main form
me.cmbvenderid.refresh



"Dave Elliott" wrote in message
...
Does the record have to be saved before a form refresh can be done?
Example; I have a main form and on it are sub-forms.
On the main form is a Vendor form and sometimes while the main form is

open,
(before saving) I have to add a vendor via another form (Vendors) and then
need to
refresh the sub-form on the main form so it will see the new vendor.
(Me.Refresh) on double click.
My question is, do I need to add code to save the record before the

refresh?





 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
copying a form Jim VanGordon Using Forms 3 July 30th, 2004 03:14 AM
Modal form Praveen Manne Using Forms 1 July 6th, 2004 10:49 PM
Complicated (maybe) form question Matt Using Forms 3 June 18th, 2004 05:07 AM
Recordset in subform based on field in parent form Lyn General Discussion 15 June 14th, 2004 03:10 PM
Form Doesn't Go To New Record Steve New Users 15 May 16th, 2004 04:33 PM


All times are GMT +1. The time now is 03:14 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.