• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 585
  • Last Modified:

Access VBA: Code to identify character postion within a string.

I need to identify where a "." is within a string i.e.2nd, 3rd, 4th position etc.  I could use nested if statements but I'm looking for something more efficient and cleaner.
0
JAMES125
Asked:
JAMES125
1 Solution
 
masteripperCommented:
How about Instr
 instr("here.it is",".") gives u 5 the position of "."
0
 
Dale FyeCommented:
Well, the Instr( ) function designed for that.

But what is your actual purpose?  Are you really concerned with where the periods/decimal points are, or are they just delimiters, and what you really need is to find out the information between the periods.  If the latter, then you need to look into the Split( ) function, which accepts a string and a delimiter and returns an array of values broken into segments around the delimiter.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now