Solved

VB6 - Remove last comma in Textbox

Posted on 2014-02-12
2
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

726 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