How To Find out anyof the subform.... info chaged(field) in the main form

A

ahmed khalak

Hi,

Thanks in advance.. if somebody can point me to right direction.
I have main form which contains 4 subforms....
I am trying to find out if at all any of the subform (field or field )
been edited
speacially 2 forms are critical .. to know if any changes(editting) has
been done...
for the calculation pupose in the main form... user is to be forced to
recalculate figure (by way of button control)
main form I can find out with isdirty event in before update event..
How I force user to push recalculate button in main form if info editted
in those mainly two forms. before main form is stored.
Ther is no need to recalculate if subforms are not editted at all.

Thanks in advance....

Khalak
 
A

Allen Browne

The best solution here is *not* to store any field in the main form that is
dependent on values in the subform. For example, if you have invoice items
in the subform, you must not store the total in the subform.

If you do have a valid reason for breaking the normalization rules and
storing the value in the main form's table, use the AfterUpdate event of the
subform (the form itself, not the AfterUpdate event of its controls) to
assign the value to the control on the main form, and then force it to be
saved so it doesn't get accidentally undone. Example:

With Me.Parent
!SomeControl = 99
.Dirty = False
End With
 
A

ahmed khalak

Thank you Allen... appreciate very much

My Main form have some calculate fields which are derived from
subforms.... table only keep couple calculated (i know we dont have to
keep calculated field in the table..but ofr future ref)

other speacialy two subforms
1. subform is for (anesthesia chart) .. fields gets three sub
calculations.. e.g. timeunits,stausunits and modifyingunits ..
2. subform is for the procedures done (cpt4 codes)... which can be upto
4 procedure (Old way.. I dont know new law )
from these procedure calunits are like for 1st procedure 100% 2nd
50% chargable and 3rd is 25% chargable
These can not be added arbitarily (if done than possibly you may
charge less)
1st one has to be wit highest baseunits, 2nd second highest and
then 3rd
e.g. 10,6,3 not 3,6,10 or 6,10,3 or 6,3,10
i have procedure and functions which do that and give me result ..
to put in this sub form which again passed to main form

all thes are fine during the first... info insertions.. if all comptely
filled...
my problem is that for any reason.. either adjustment or incorrectly
input.. if record has to be editted..
i want to know before upading the form.. whether any of the sub form
was tried to change the value.. then and than
its imperative for me to recalculate...(some time it could be fee base
some time flat fees)
All the tables are in relations. and normalised... (though i will try
to keep thes in the atleast 3rd normal)

couple of calculated field i kept in main form for the reason at what
period billing or charges were done and what fee rate..
some time 2 ,3,4 years fee structure change..
this is the reason am looking to see in mainform before update if at
all any (critical )subform is made dirty..
if it is then recaculate buuton needs to be pressed before update...
I hope I clearified .. this is the program which in 1981 I wrote in
DbaseIII and used for anesthesia billing and A/R. I am trying to put
in Access......
Thanks
Khalak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top