Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all! i have 2 strings : fi 1

Status
Not open for further replies.

popo666

Programmer
Jul 8, 2002
13
0
0
CA
Hi all!

i have 2 strings :

fileNumber
subFileNumer

subFileNumber is comprised of the fineNumber plus some extra characters

ex. : fileNumber = "123456"
subFileNumber = "123456-1"

my question is, i want to make sure , before recording the subfile number into the db, that the subFileNumber starts with the fileNumber.

i know how to do this in java , but in vba i am clueless

Thx in advance
Fred
 
You can use the InStr() function:
Code:
fileNumber = "123456"
subFileNumber = "123456-1"

If InStr(1, subFileNumber, fileNumber) = 1 Then
    'Yes, the Sub File starts with the File No
Else
    'No, it doesn't
End If
 
thx dsi :)

really helpful

have a nice day

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top