Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / June 2007

Tip: Looking for answers? Try searching our database.

Refresh Form - Help?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dmericksen - 27 Jun 2007 17:04 GMT
I have an interesting problem (maybe its not so interesting to the gurus who
frequent this board :) ).  Here is the back ground information:

I have a form that contains tab controls and several sub forms. The main
form contains a control that dictates what data is displayed on one of my sub
forms via parameters in the query (data source).

So, I have added some code to the "after update" event that looks like this:

---------------------
me.form.refresh
me.form.requery
---------------------

I have also tried:

---------------------
Me.[sub_form_control_name].Requery
---------------------

The result: sub form just comes up blank.  If I view the form in design view
and then in normal view again, then the correct data shows up.  For some
reason, the sub form is not reloading.  

Can you help?
AKphidelt - 27 Jun 2007 17:16 GMT
Hey, not sure if Im right... but where is your AfterUpdate coming from?

A combobox, textbox? If so most likely you have to right something like

Me.Requery "sub_form_control_name"

I think your current code is not activating the requery event.
lmk

> I have an interesting problem (maybe its not so interesting to the gurus who
> frequent this board :) ).  Here is the back ground information:
[quoted text clipped - 21 lines]
>
> Can you help?
dmericksen - 27 Jun 2007 18:52 GMT
I tried this and when I run it I get  a compile error ("Invalid arguments")  
Here is the exact code I used:

Me.Requery "sub_media1"

> Hey, not sure if Im right... but where is your AfterUpdate coming from?
>
[quoted text clipped - 4 lines]
> I think your current code is not activating the requery event.
> lmk
rtviper - 29 Jun 2007 18:28 GMT
I may be wrong, but I think you need to refresh your subform
"Me.subformnname.refresh" Also, once you enter data into the subform, it may
be going on to the naext record which may or may not be blank.

> Hey, not sure if Im right... but where is your AfterUpdate coming from?
>
[quoted text clipped - 30 lines]
> >
> > Can you help?
Douglas J. Steele - 27 Jun 2007 17:32 GMT
The correct way to refresh a control on a subform from the parent form is:

Me!NameOfSubformControl.Form!NameOfControlOnSubform.Requery

Note that depending on how you added the form as a subform, the name of the
subform control on the parent form may not be the same as the name of the
form being used as a subform.

You might be interested in http://www.mvps.org/access/forms/frm0031.htm at
"The Access Web"

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I have an interesting problem (maybe its not so interesting to the gurus
>who
[quoted text clipped - 25 lines]
>
> Can you help?
dmericksen - 27 Jun 2007 18:52 GMT
Douglas-

I am not trying to refresh a control on a subform.  I am trying to refresh
the data or query set for the subform.

Any other ideas?

> The correct way to refresh a control on a subform from the parent form is:
>
[quoted text clipped - 6 lines]
> You might be interested in http://www.mvps.org/access/forms/frm0031.htm at
> "The Access Web"
Douglas J. Steele - 27 Jun 2007 19:13 GMT
In that case, you want

Me!NameOfSubformControl.Form.Requery

Did you check the reference I gave you?

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Douglas-
>
[quoted text clipped - 16 lines]
>> at
>> "The Access Web"
dmericksen - 27 Jun 2007 21:02 GMT
Yes, I did see your reference (and yes, it is very helpful!).  However, I am
still having problems. I used the exact syntax you put forward
(Me!NameOfSubformControl.Form.Requery) and I get errors.  I will post the
errors in another post.

> In that case, you want
>
[quoted text clipped - 22 lines]
> >> at
> >> "The Access Web"
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.