Hi deb,
I created a little function that should help you out.
Go into tools|macro|visual basic editor and insert a module.
Paste this code into the module:
Code:
Function Delim(str As String, ind As Integer)
Dim arr1 As Variant
Dim ct As Integer
Dim j As Integer, i As Integer
Dim x
j = 0
ct = 1
For i = 1 To Len(str)
If Right(Left(str, i), 1) = "|" Then
ct = ct + 1
End If
Next i
ReDim arr1(1 To ct)
For i = 1 To ct
Do
If j > Len(str) Then Exit Do
If Left(Right(str, Len(str) - j), 1) = "|" Then Exit Do
x = Left(Right(str, Len(str) - j), 1)
arr1(i) = arr1(i) & x
j = j + 1
Loop
j = j + 1
Next i
Delim = arr1(ind)
End Function
This is a new function that you can use in a query to pull an indicated field from your string(John|A|Doe|30Mar2003|G1). The function is delim(str, ind) and has two arguments, str being the string with the pipes("|"), and ind being the field number (G1 is 5). You can use this as an expression in a query.
Start a new field in the query that has this data, and enter this where it says field in the design grid for the query:
Name: delim([string_field],1) & " " & delim([string_field],2) & " " & delim([string_field],3)
Now start a new field and enter this:
Date: delim([string_field],4)
And finally, the dept field:
Dept: delim([string_field],5)
I xan send you an example, but it will be in Access2000, but the method should work in 97.
HTH,