Format as currecy for just the one current record

SteveL13 used Ask the Experts™
I have a form that is a datasheet view form.  There are two fields on the form.  One is Category (cboCategory) and the other one is NetAmount (txtNetAmount).  If Category = "Volume" then I want txtNetAmount to display as Currency But Just For That Record.

Right now if I select "Category" all of the Net Amounts display as currency in all of the records.  They need to display as Single, Standard, 2 decimals like the field is formatted in the table.

What am I doing wrong?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
In a relational database the data types of all rows in a column are expected to be the same.  You seem to have some rows where the contents of a field are currency and other rows where the contents is still numeric but not currency.  Sounds like you are trying to make Access behave as a spreadsheet.  

I actually have an application where I need to do this.  The schema is a very rare Entity-Value-Pairs design.  The application supports an insurance company and in order to allow them to create new policy types with new data fields on the fly, the table that holds the policy detail fields has this layout:

UniqueID (autonumber PK0
PolicyID (foreign key to policy header)
FldID (foreign key to field definition table)
DataValue (actual contents such as 5/6/17, $3,500,00, and even 101 Main St)

If a new policy type requires a data field that we have never defined before, the user has to define it in the field table along with its attributes so the update form will know how the saved data needs to be formatted.  Then the field can be assigned to a policyType and used for data entry for a specific policy.

You can only do this if you store the data as text.  Then in the AfterUpdate event of the CONTROL, you apply the format based on some other field.  However, saving numeric data as text makes it very difficult to use for arithmetic and completely useless for relative value comparisons or sorting.

Conditional formatting does not support anything but font and color changes.


Perfect explanation.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial