Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My If...then statement not cooperating

Status
Not open for further replies.

bren11

Programmer
Mar 14, 2002
21
US


I have a calculated text box on a form. I want it to display 0.00 if the calculated amount is less than 0.00.

Wouldn't it be

If TextCalc.Value < 0.00 then
TextCalc = 0.00


Or something to that effect?
 
I have a calculated text box on a form. I want it to display 0.00 if the calculated amount is less than 0.00.

Wouldn't it be

If TextCalc.Value < 0.00 then
TextCalc = 0.00


Assuming your textbox is using a currency data type then,

if me.textcalc.value < 0 then
me.textcalc.value = 0
endif
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 

Thanks for your reply...I had a syntax error that your suggestion pointed out to me...however, now when I run the calculation, it tells me the recordset is not updateable.
My form is based on a query with 3 tables, however the calculated field is only referenced later in an update query.

Can I make this be an editable field? Thanks for your syntax help, though....that was a big part of the problem..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top