Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1030175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:39:30+00:00 2026-05-16T12:39:30+00:00

i have an old string say oldString=abc-2 i want to change it to abc-3

  • 0

i have an old string say oldString="abc-2" i want to change it to "abc-3"
so i did this

myArray = Split(oldString, "-")
oldP = myArray(UBound(myArray))
myArray(UBound(myArray))= Str(val(oldP) + 1)
newString=join(myArray,"-")

why do I get the wrong number??
and if i try to use Cint(), then i got Error.

please help…

just found the real problem.
I changed my input mode by accident and put a “Double-byte” number 2 into the same Field ,where i got my oldstring, of another Record. And after that CInt recognize my oldstring as wrong type. It seems that ms-Access changed the encode of that field implicitly, so that Cint do not know what to do and Val get the wrong value.
They should have made Textfield in Access, String functions all encoding independent, or all use UTF-8.
At least it should warn me when it change the encode of that textfield.
Maybe i Should report it to MS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:39:30+00:00Added an answer on May 16, 2026 at 12:39 pm

    If your joint function works well all should be fine. What you could try is this:

    Open up VBA in Access and then open your Immediate window (View->Immediate window) Then execute these linese one by one and post your results.

    oldString="abc-2"
    myArray = Split(oldString, "-")
    oldP = myArray(UBound(myArray))
    ?oldP
    

    This should promt 2 as the answer to ?oldP

    myArray(UBound(myArray))= Str(val(oldP) + 1) 
    ?myArray(1)
    

    This should prompt 3

    newString=joint(myArray,"-")
    ?newString
    

    This should prompt “abc-3”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to change some connection strings in an incredibly old legacy application, and
We have two lists, let's say students and their scores. I want to compare
Say I have two std::set<std::string> s. The first one, old_options , needs to be
I have an old .dot file with a few dozen styles in it. I
I have a old website that generate its own RSS everytime a new post
I have several old 3.5in floppy disks that I would like to backup. My
I have an old server with a defunct evaluation version of SQL 2000 on
I have some old rrdtool databases, for which the exact creation recipe has long
I have an old Delphi codebase I have to maintain, lots of DLLs, some
We have an old project written using Managed C++ syntax. I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.