Dan Swartz
Board Regular
- Joined
- Apr 17, 2020
- Messages
- 53
- Office Version
- 365
- Platform
- Windows
Not sure if i can explain this well enough but I'll try. I have a userform for making payments on an invoice. You enter the invoice number, search and it brings up all the necessary info. There are 4 textboxes that are Currency, so I used the following code to format the text boxes. if no payments have been entered, my code works great. but if i want to go look at an invoice or if they are splitting payments and i want to enter another payment. the currency format goes away. I tried to use "Change" instead of "AfterUpdate" and if I do that, it will not let me enter my values correctly. For example, if I want to enter 250, it will enter 2.01. I have attached some pictures to help
In the picture called "initial customer payment", you can see I pressed the tab key after I entered the amount of the first payment.
In the picture called "Second Customer Payment", you can see what it looks like after I entered the invoice and searched for it. It displays the first payment as just a number. not currency.
In the picture called "initial customer payment", you can see I pressed the tab key after I entered the amount of the first payment.
In the picture called "Second Customer Payment", you can see what it looks like after I entered the invoice and searched for it. It displays the first payment as just a number. not currency.
VBA Code:
Private Sub PayAmt_AfterUpdate()
PayAmt.Value = Format(PayAmt.Value, "$#,##0.00")
End Sub