Home > Enterprise >  Can't change textbox's backcolor in form whenever it's empty
Can't change textbox's backcolor in form whenever it's empty

Time:09-20

I'm trying to change textbox's backcolor when it's empty. I tried using conditional format

Value <= 0
Value = Null
Value = ""
Expression is [price] <= ""

and writing VBA code for that:

Me.price.BackColor = IIF(isNull([price].Value), vbRed, vbWhite)

The value which is assigned to textbox is price a number type(example: 53,37) while textbox's is string like for example 21,22.

CodePudding user response:

I fixed it. I set conditional format on price textbox following conndition:|

Expression is [price] is Null

  • Related