me.requery isnt working

  • Thread starter Thread starter nydia
  • Start date Start date
N

nydia

I have a subform based on a query(it's used as a
calculator), when a clients end date is entered into the
enddate field (the end date is in another subform), there
are follow-up dates calculated (i
used a dateadd). I put this on the form, so the user can
see when a follow-up is needed.

The problem is when a end date is entered (in a different
subform), the follow-up
dates don't show, the user has to close the form and
reopen it so that the dates will show. how can i fix this
problem. I tried using the me.requery in the after update
in the enddate, but it still doesnt work. can someone
please help.
 
Hi,


"Me" refers to the form (sub-form), report, or the exact object
(of a class) that runs the actual code, not necessary to the "parent" form
(in the case the code is under a form used as subform). Me.Requery will have
a side effect you can't fail to observe if the form is bound to something:
the "form" is reposition at the first record, and so, whatever was in the
bound-controls would display the data of that record, not the one you were
editing in the first place, before executing the Me.Requery. Sure, if the
"actual" record is dirty, when your code execute Me.Requery, the actual
record has to be SAVED and if it fails to do so, a trappable error should
have occurred. So, when you say "it still does not work" , what do you mean,
really... DO you have a bound form? Are you somewhere else than at the first
record? Do you have a dirty record? Do you run the Me.Requery in the
sub-form or in the form (where the code "Me.Requery" is written) ? What do
you have used for error handling? Have you "stop" the code just before the
Me.Requery and then, debug it step by step, one line at a time, to see what
exactly is running after the Me.Requery?



Hoping it may help,
Vanderghast, Access MVP
 
i commited the crime of double posting. I had posted this
question on02/17/04 @ 8:15am in the forms section and got
a suggestion to me.requery. I did a post reply after that
suggestion, but never go a response (i know that you are
all busy and cant be on my bekon call). That's were i got
the me.requery. I ended up putting a command button on
this subform and on click put a me.requery and it works.
I'm learning to build dba's throught this newsgroup, so i
don't alway understand the language. I thank you all, who
post suggestions because without you's i would be lost.
 
Back
Top