Solved

VB6 - Remove last comma in Textbox

Posted on 2014-02-12
2
297 Views
Last Modified: 2014-02-12
Hi all

I would like to know how i can remove in my Text5 the last comma chowing at the end.

Ex;

If i have the value ; 1,2,3,4,5,6,7,8,

Then, it should remove the last ",".

The final answer would be: 1,2,3,4,5,6,7,8


But if i have the value: 1,2,3,4,5,6,7,8

Then since their is no comma as the last digit in the TextBox, the final answer would stay the same: 1,2,3,4,5,6,7,8

How can i do that?

Thanks
0
Comment
Question by:Wilder1626
2 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 500 total points
ID: 39855002
This should remove any trailing commas
    Do While Right(Text1.Text, 1) = ","
        Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
    Loop

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 39855009
HI

This is great. Thanks for your help
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question