How to add a letter at the begining of a number

Posted on 2006-04-12
Last Modified: 2010-05-01
i want a code in vb to add a letter at the begining of a number. I have counter in vb application, it counts everytime when you exported the data to a file.
exp: counter number: 1 ---it has to be with the code ---> AB1; count nr: 2 -- has to be ->AB2, etc ..... .
the code has to add "AB" everytime at the begining of a numer.

Question by:jefmelkenbeek
    LVL 92

    Expert Comment

    by:Patrick Matthews
    Hi jefmelkenbeek,

    How is this counter used?  Where is it stored?  How do you use it in your app?



    Author Comment

    hi patrick,

    it counts everytime when you export data to word.
    exp: all textfields exported to word.

    when i click on export_click button ( it has to count.
    it is stored under:
    Private sub export_click (byval sender as ....)
    dim ...
    if (flagConfirmed = False) then
     label1.text = readLastnumer () + 1
    end if
    LVL 28

    Accepted Solution


    Couldn't you do something like this?
    label1.text = "AB" &  readLastnumer.ToString

    Author Comment

    no it doesn't work.
    label1.text = "AB" &  readLastnumer.ToString in stead of label1.text = readLastnumer () + 1 ==>doesn't work

    Author Comment

    sorry Patrick,

    it works :-). thank you very much for your help


    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    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…
    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…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now