If you just change your formula to Value(varCurrentDay) < 6, then your error should be gone and it should work as you expect.
------------------------------
Harsh Naik
------------------------------
Original Message:
Sent: Feb 17, 2022 09:13 PM
From: Beth Beck
Subject: Change data card DisplayMode based on multiple conditions
In my Power App, users can enter their bike miles for the current month AND they have until the 5th of the following month to record miles for the current month. So I could record February miles until 3/5/22. I'm using some variables for the first condition. Property: DisplayMode Function: If(varFebMonth = varCurrentMonth, DisplayMode.Edit,DisplayMode.Disabled) I'm stuck on how to create condition to allow users to also enter miles for first 5 days of the month. See screen shot.
I've tried adding this formula to the Feb month control, but still not working. I'm thinking there's an issue with the variables in my OnStart being "Text", but the calculation expects a number, which is why I added "Value" in the formula.
If(varFebMonth = varCurrentMonth || (Value(varFebMonth) = varCurrentMonth-1 && varCurrentDay<6), DisplayMode.Edit, DisplayMode.Disabled)
------------------------------
Beth Beck
O365 Business Analyst
Fort Myers FL
------------------------------