combo box, column, calculated control,

S

Skunk

I have a refund entry form with a combo box for the user to select an invoice
to partially refund. There may have been prior refunds charged to the
selected invoice. The columns include calculated controls to display the
price as well as the sum of all refunds for that invoice. The user sees the
columns correctly displayed.

After selection user inputs an amount for the refund being entered. I have
unbound controls set to the price [txtPrice] and refunded [txtRefunded]
column values. [txtPrice] and [txtRefunded] are calulated in the query
record source. This works, I see them.

I wish to test the entered amount [txtAmount] against the orginal invoice
amount [txtPrice]) and any refunds already made ([txtRefunded] for
over-refunding.

Seems simple enough. Can't make the test...it always allows entry.

In BeforeUpdate event of [txtAmount] I code "If me.txtAmount > (me.txtPrice
- me.txtRefunded) then . . . " For testing I display a message -- which
hasn't displayed yet!

However, I am unable -- in the BeforeUpdate event -- to either:

1. test the values of the unbound contols (which are based on calculated
columns)
[txtAmount] > ([txtPrice] - [txtRefunded])
Simplified test [txtAmount] > [txtPrice] does not work either.

2. test the column values themselves
[txtAmount] > cboInvNum.Column(4)

What's wrong? What haven't I done or considered? Any help is appreciated.
I know this should be easy, just cannot see it. Not a pro, btw.

Thanks.
 
D

Dennis

I don't think you're code is in the correct event. You might try using the On
Exit event, which will fire when the person tabs out of the field.
 
S

Skunk

No, anywhere I try to compare a control based on a column in acombo box which
is calculated, I get no test. Ex: when I test for [txtAmount]>[txtPrice]
where [txtAmount] is as described above, it always evaluates as False,
whether its really true or not.

I am lost with this.

Dennis said:
I don't think you're code is in the correct event. You might try using the On
Exit event, which will fire when the person tabs out of the field.

Skunk said:
I have a refund entry form with a combo box for the user to select an invoice
to partially refund. There may have been prior refunds charged to the
selected invoice. The columns include calculated controls to display the
price as well as the sum of all refunds for that invoice. The user sees the
columns correctly displayed.

After selection user inputs an amount for the refund being entered. I have
unbound controls set to the price [txtPrice] and refunded [txtRefunded]
column values. [txtPrice] and [txtRefunded] are calulated in the query
record source. This works, I see them.

I wish to test the entered amount [txtAmount] against the orginal invoice
amount [txtPrice]) and any refunds already made ([txtRefunded] for
over-refunding.

Seems simple enough. Can't make the test...it always allows entry.

In BeforeUpdate event of [txtAmount] I code "If me.txtAmount > (me.txtPrice
- me.txtRefunded) then . . . " For testing I display a message -- which
hasn't displayed yet!

However, I am unable -- in the BeforeUpdate event -- to either:

1. test the values of the unbound contols (which are based on calculated
columns)
[txtAmount] > ([txtPrice] - [txtRefunded])
Simplified test [txtAmount] > [txtPrice] does not work either.

2. test the column values themselves
[txtAmount] > cboInvNum.Column(4)

What's wrong? What haven't I done or considered? Any help is appreciated.
I know this should be easy, just cannot see it. Not a pro, btw.

Thanks.
 

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