General question on an event

  • Thread starter Thread starter NNlogistics
  • Start date Start date
N

NNlogistics

Many times I will use a text box to make a calculation. For instance the
control source would be equal to the txtSubtotal * txtTaxRate. The problem
I have is that I can't use that txtbox to register the "SalesTax"(Txtbox with
Control source = fldSalesTax). So what I usually TRY to do is have another
xtxbox(txtSalesTax) = to the txtbox with the Calcualation
(txtSalesTaxCalculation). The problem is that I need an event that monitors
the Calculations txtbox and when it changes it will update the txtSalesTax
with no other manual interaction.

I hope thats clear.

Am I approaching this wrong or is there an event that will do the job. I
seemm to have tested all the obvious ones.
 
The general rule is that you don't store calculated values in tables. In your
case
you may have one of the exeptions to that rule, if you need to store the value
for historical reasons., i.e. you need past invoices to show the amount of
sales tax that was paid. However, if that is the case, then you certainly
would
not want your application to recalculate old sales tax amounts when the tax
rate changes.

So, if you don't need to keep the sales tax amount for some historical reason,
then don't store it in the table. If you do need to keep it, don't
automatically
recalculate it.
 
I would differ on this, Beetle
I would suggest the applied tax rate be stored in the table at the line item
level and the tax amount always be calculated.
If the tax rate changed this morning and you print invoices on yesterday's
orders, you are hosed.
 
I see your point Dave. You're right, that would be the more appropriate way
to do it.

Give my regards to Professor Barnhardt. :-)
 
The professor from "The Day the Earth Stood Still" (if I'm not mistaken)

Sorry, guess my attempt at humor missed the target.
 
Guys

Thanks for the input and getting me back on track regarding storing
Calculations. also I'm happy to see a little sense of humor.

now

I'm still looking for a way to monitor a change in a text box without
clicking on it, entering it, etc. Is there such an event?

also

Is anybody else having problems locating the signin button on the discussion
web page?
 
As to your first question, if you're talking about monitoring a change in
a calculated text box where a user doesn't actually make the change, I'm
not sure. I think the On Change and On Dirty events only fire if a user enters
the control and makes a change, but I might be wrong. I'm sure Dave
would know if he's still tracking this thread.

As to your second question, yes. It depends on how you're viewing the
newsgroup. I tend to prefer the layout of the MS web pages over, say,
Google groups, but the MS web pages are certainly more "buggy". The
sign in button disappeared a few months ago and hasn't been back
(at least on my browser). I usually just click reply to get to the sign in
page, but even then, after you sign in you sometimes just get a blank
screen, and you have hit the back button a couple of times to get back
to the newsgroup. It would be nice if they would fix it, but I don't think
that's going to happen.
 
I'm not sure where the sign in button is. I have a link set up and the
discussion groups always come up with me logged in. After a few years, I
forget stuff like that.

Okay, so you want to get serious again.
If the text box has a calculated control source based on other controls on
the form, it should automatically update with the correct value.

If this isn't happening, post back with some detail and we can troubleshoot
the problem. If I can't come up with an answer, maybe another joke would do?
<g>
 
Dave

It does update the calculated txtbox.

I am adding the total square ft in a calculated box and when it goes over
100 sg ft I need to set off another routine (remember the loop through a
query and change pricing, which I havent figured out yet). If there were an
event that would recognize the change, that would work for me.

I hope this is not taking to much of your time, on the other hand I hope its
challenging.
 
If I recall correctly, this is as you are entering records in a subform.
And, you have a control that shows the total square feet.
If that is correct, I think the subform's form After Update event would be
the place to check that.

BTW, I have square feet. I wear an 8/12" E
 
Thanks David. Honestly, i had overlooked the fact that forms had these type
of Events. When I figure out the answer to my ADO issue, I'll give it a try.
 
Oh, right. We still have that.
Sorry, but since when I started with Access, there was no ADO. I have tried
it a time or two, but I am very comfortable with DAO, so sort of stuck with
it.

I suggest you start a new post with that question.
 
Back
Top