In my database i'm keeping peoples names in the following format Surname, FirstName. When i bring back these details to the form in VB i want to split the string. I'm using the InStr function to try and split it on the comma. I have no problem assigning just the surname part to a variable as follows:
varname = left$(FullName, mypos - 1)
Where mypos is the postion of the comma from the InStr function.
Now if i try
varname1 = Right$(FullName, mypos + 1) then i get the following error:
"Type declaration character does not match declared data type" I have both varname and varname 1 declared as strings so i don't see what the problem is. If i remove the "$" then i get an "expecting an array" error. If anyone has any insight into this or can suggest an alternative way to manipulate the string i would appreciate it. Thanks
varname = left$(FullName, mypos - 1)
Where mypos is the postion of the comma from the InStr function.
Now if i try
varname1 = Right$(FullName, mypos + 1) then i get the following error:
"Type declaration character does not match declared data type" I have both varname and varname 1 declared as strings so i don't see what the problem is. If i remove the "$" then i get an "expecting an array" error. If anyone has any insight into this or can suggest an alternative way to manipulate the string i would appreciate it. Thanks