Home > Software engineering >  How to format display for numbers alignment
How to format display for numbers alignment

Time:12-12

I have data in Access 2019 tables and want to combine them so they look like this Value (Rating):

AchievementALL=-2..................2nd Value=9....3rd Value=-64

AchievementALLRating=2.............2nd Value=10...3rd Value= 11

RESULT1=-02 (02)

RESULT2= 05 (10)

RESULT3=-64 (11)

Field Format=00

Here is my formula: =([AchievementALL] & " (" & [AchievementALLRating] & ")")

Unfortunately here is my display:

-2 (2)

9 (10)

-64 (11)

I am trying to make it look pretty so the numbers/characters align

Any and ALL help is greatly appreciated

CodePudding user response:

That field format doesn't work because expression uses actual values of fields and Format property set for each field individually is ignored.

One way to accomplish uses Format() function to pad with leading zeros, like:

Format(AchievementALL, "00") & " (" & Format(AchievementALLRating, "00") & ")"

That can be in a query or in textbox ControlSource (precede with = sign in textbox). Set textbox TextAlign property to Right.

Have to use as many zeros as there are possible digits.

  • Related