textbox cannot enter letters and numbers

Patriot2879

Well-known Member
Joined
Feb 1, 2018
Messages
1,227
Office Version
  1. 2010
Platform
  1. Windows
Hi hope youcan help me please, I have attached the file below which I am stuck on, I havea user form ‘enter expenses’ but when I try to enter number/letter combinationin the boxes for Airfare, accommodation, ground transport and food and drink,the box goes red when I click on update and it doesn’t transfer the informationto the enter expenses sheet, I hope you can help me please?
https://www.dropbox.com/s/r6k2c5lln3m1ij8/Copy%20of%20Excel-Forms-Insert-Update-Delete.xlsm?dl=0
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I just tried your UserForm... as long as you put numbers only into the Airfare, Accommodation, Ground Transport, Food & Drink and Misc. fields, everything seems to work fine. What "letters" are you trying to place in those fields and, more importantly given they seem to be expecting currency amounts, why?
 
Upvote 0
Hi I wantedto put like areas or initials with age(SA47) andwhat food eaten or drank for example wine and steak , originally it was the priceof things but I do not need this now.
 
Upvote 0
originally the currency was for the pricing of food, airfare etc but I don't want to count this now, I would prefer to record where accommodation is or the postcode for example what they had to eat and like a reference numbers etc which includes numbers and letters hope you can help me please?
 
Upvote 0
Hi I wantedto put like areas or initials with age(SA47) andwhat food eaten or drank for example wine and steak , originally it was the priceof things but I do not need this now.
You have a function named IsAcceptedNumber which is testing values and seeing if the value entered into the TextBoxes are able to be converted to Double data types or not. You need to use VBA's Find (set the search for entire project) to find where this function is being called and, for whichever TextBoxes you want to allow text to be entered, stop the code from calling that function.
 
Upvote 0
wow OMG that is well over my head, sorry I am quite new to this and still learning, is it quite easy to change/update?
 
Upvote 0
thank you for the advise, hope you can still help me please as I don't know what to do now.
 
Upvote 0
thank you for the advise, hope you can still help me please as I don't know what to do now.

I am about to go to sleep for the night right now, so I cannot look at it yet. However, I will need to know which TextBoxes are now supposed to be able to take text instead of numbers. Also, once the TextBoxes are modified to be able to take text, what happens to the Total row at the bottom of the table (given that you cannot total ups non-numeric values)?
 
Upvote 0
Hi, the total box at the bottom and to the right, this will need to be deleted, the textboxes that I want to be changed to text/numbers are, airfair, accommodation, misc, food and drink, ground support, thankyou for the help.
 
Upvote 0
Hi, the total box at the bottom and to the right, this will need to be deleted, the textboxes that I want to be changed to text/numbers are, airfair, accommodation, misc, food and drink, ground support, thankyou for the help.

Let me start by saying I did not review your entire project, but given what you say you want the code to be able to do, I think the following suggestion will do it correctly for you. In the ExpensesForm UserForm's code window is a function named CheckForErrors... inside it is a For Each loop with a Select Case TypeName(Ctrl) statement... the first code block inside that Select Case is the Case "TextBox" code block... I think you need to comment out the entire Else block (you could delete it, but if I am wrong, it would be hard for you to reestablish the code, so I recommend commenting it out instead). Once you have done that, it looks like the code will accept text in all the TextBoxes on the UserForm.
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,301
Members
448,885
Latest member
LokiSonic

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top