Format of Number depending on content of field

  • Thread starter Thread starter Darrell Childress
  • Start date Start date
D

Darrell Childress

I am developing an HR database and trying to show deductions for each
employee on a subform. The 2 relevant fields are "dedid" and "dedrate".
"dedrate" is a number field but can mean 2 different things.

If dedid = 401, then dedrate is a percentage
If dedid - 401$, then dedrate is a dollar amount

I would like my form to reflect this. In other words, if the field
"dedid" = 401 and "dedrate" = 2, then I would like the number in field
dedrate to display as 2%. But if "dedid" = 401$ and "dedrate" = 15, then
I would like the number in field dedrate to display as $15.00

By the way, the records are from a linked table in Visual FoxPro, so I
cannot change the format of the stored value.
Thanks for any help,
Darrell
 
Wow! Sorry you have to live with a design were the logic is in the data and a
field can be diffrent things. Your best bet is to put code in the After
Update event of dedid that sets the format property of dedrate.
 
Back
Top