Tricky - keeping two fields "in sync"

M

Maury Markowitz

This might be hard to describe, but I'll try...

I'm writing a ticket editor for buying and selling stocks. You (the user)
puts in what you _want_ to get, for instance "1000 IBM @ 60". Now maybe
you're lucky and that's what you get, but many times you'll get a better
price, or a smaller quantity. For instance, the order above might come back
from the broker as (600 IBM @ 59.95).

I'd like to be able to capture this difference - that's the easy part, I
have two fields - but I don't want to force the user to type things in twice
if it is the same. My old version did this, and invariably the user didn't do
it right and put the wrong values in (amazing!). So I've added some code that
says that if you change the order quantity or price, it should "copy down"
those values into the fill quantity/price.

Here's the tricky part. Let's say the user types in 1000 @ 60 and the system
"fills down", automatically filling out the fill details. Now the user
realizes that they actually meant to type 1000 @ 70, so they go to the fill
price and type in 70. In this case it's almost certainly OK to "copy down",
and change the fill to 70 as well.

Ahhh, but what if the user changed the fill price to 59.95? In that case I
should _not_ fill down, as the fill was different than the order in this
case. The order might have been 70 all along, but if the fill was 59, the
fill was 59.

Now here's my question (at last!), how do I recognize this condition? I
can't simply say (order price = fill price), because Access has already
updated the order price to the new value, so for the example above it will
say 70 = 60 and not do the fill down. What I really want to say is "if the
old order price is the same as the old fill price, then update the fill
price".

Does that explaination make sense? If so, is there some way to capture the
"before value" in my macro? Or some other way to accomplish this?

Maury
 
D

DevalilaJohn

You are not real clear on the process, but to answer the final question, ther
is an OldValue property to most of the controls you might use in a form.
Perhaps that's what you are looking for.
 
M

Maury Markowitz

DevalilaJohn said:
You are not real clear on the process, but to answer the final question, ther
is an OldValue property to most of the controls you might use in a form.
Perhaps that's what you are looking for.

This is exactly what I was looking for, thanks!

Maury
 

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