Hi,
I would like to enter a number whose minimum and maximum length is 6 and 13.The number should be diaplayed as in the form of XXXX1234 i.e only last four digits should be diaplayed and the remaining should be diaplayed as X.
Can you send me the code.
For example if I enter 1234567 it should display as XXX4567
if I enter 89345684 it should display as XXXX5684
Note: The number I enter is having minmum length of 6 and maximum of 13.
7 7905
1.find out the length of the string.(ensure that is in the range of 6 and 13)
2.use right(string,4) to findout last 4 characters
3.filll the remaining with "X" from left side.
As you have already said you want to check of 6 digit to 13 so this code does not check that but checks to show XXX -
A = Text1.Text
-
LENA = Len(A)
-
C = Right(A, 4)
-
For I = 1 To LENA - 4
-
D = D & "x"
-
Next
-
E = D & C
-
Label1.Caption = E
-
Hello,
Use this code - Text2.Text = Right (Text1.Text,4)
Have a nice day.
>> ALI <<
Hello,
Use this code - Text2.Text = Right (Text1.Text,4)
Have a nice day.
>> ALI <<
then what about the remaining characters ?
Who will convert that ?
then what about the remaining characters ?
Who will convert that ?
I am really very sorry about that. I forgot about that.
This is the right code: - Private Sub Command1_Click()
-
-
For i = 1 To Len(Text1) - 4
-
Text2 = Text2 & "X"
-
Next
-
-
Text2 = Text2 & Right(Text1, 4)
-
-
End Sub
Regards
>> ALI <<
Simplifying ali’s code. - 'Will return string length of text1 -4 characters “X” to Text2
-
Text2 = String(Len(Text1) - 4, "X")
-
'Add last 4 characters with Text2
-
Text2 = Text2 & Right(Text1, 4)
Note: As site rule should not post code without explanation.
Well, if it's about simplifying (or at least shortening) the code, how about... -
' Copy string from Text1 to Text2 with all but last 4 characters masked
-
Text2 = String(Len(Text1) - 4, "X") & Right(Text1, 4)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: middletree |
last post by:
http://www.middletree.net/debug/DisplaySortableTickets.html
Doing an Intranet-based app in ASP. I put the view source version (that is,
no ASP code) out on my personal site at the above URL to...
|
by: Mr Newbie |
last post by:
Does anyone know of a GOOD but FREE package which will parse my web logs and
display standard information about hits, top visitors, referrers etc etc.
Cheers
--
Best Regards
The Inimitable...
|
by: RonHouston |
last post by:
Hi,
I was wondering if someone could help me on this one.
Is there anyway to format a string/integer etc so that it always outputs a 4 digits number?
thank you.
Ron.
|
by: dhutton |
last post by:
How would one go about grabbing just the last 5 digits of a 16 digit number - then prefixing the last 5 numbers with 99800
so if the number is 8351101100000029 I need my SQL (Microsoft) to grab...
|
by: imtmub |
last post by:
I have 3 table for Purchase Order from ERP Database
Tables:
POD=Purchase order Details(this table has Require Qty field)
POR=Purchase Order Receive (This table has RequireQty and ReceiptQty...
|
by: mbewers1 |
last post by:
Hi there
I need to return the last 9 characters from a string, no matter what characters there are before it. Tried this:
string id =...
|
by: andersond |
last post by:
I am haviing a problem getting fields from a datatable to display if they contain digits, like 5.00 or $25.00. My php page will display any other variables without any problems. How can I get these...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |