Character counting without spaces (1 Viewer)

des-Toblaave

New member
Local time
Today, 06:19
Joined
Mar 22, 2024
Messages
4
Hi I new to access and I’m trying to have a text box that counts only the characters in another text box. This is a viral piece to allow me to get all of my company’s admin away from lots of word files and on to access. Please help, I have one txt box called “inscription” and the other is called “character count”
 
No example provided so guessing if the text is ‘hello world’ you want a count of 10, not 11

in which case try

Len(Replace(“hello world”,” “,””))
 
Sorry for not being clear, I’m very new to this. I’ll try to explain more. One text box where the amount of text is different for each record. I need to know what vb code to add to a second text box so that I can see the amount of characters without spaces. It’s to be used to calculate a price based upon the number of characters. I hope that helps
 
I’ll try to explain more.
if in doubt - show an example rather than describing it

and did you try the example I provided?

in a query it would be something like

SELECT myField, Len(Replace([MyField],” “,””)) as CharCount
FROM myTable

Alternatively in a form the controlsource for the CharCount control would be

=Len(Replace([MyField],” “,””))
 
DT,

Can you tell us more about the following?
used to calculate a price based upon the number of characters.
It might be helpful if you could tell readers a little about the "business" involved and where database fits/might fit with the production/administration or ?? of word documents. CJ has given responses to your specific question, but perhaps there is more involved than just counting characters.
 
The issue is probably more one of me not knowing where to put the answer CJ has given. I was hoping for a full explanation as I said I’m very new to this but the answer seems to assume my knowledge level is higher than it is.
 
The issue is probably more one of me not knowing where to put the answer CJ has given. I was hoping for a full explanation as I said I’m very new to this but the answer seems to assume my knowledge level is higher than it is.
n a query it would be something like

SELECT myField, Len(Replace([MyField],” “,””)) as CharCount
FROM myTable

Alternatively in a form the controlsource for the CharCount control would be

=Len(Replace([MyField],” “,””))
Other than typing it in himself, little more he can say about it? :(
 
here is a demo, open Form1 and see the code (VBA) in Module1.
 

Attachments

Users who are viewing this thread

Back
Top Bottom