This a a long convoluted string parsing question...
I have a string in an Access 2K database table field that I use for
noting if a user has checked a record.
The string goes like this:
x[UserID]y
So the field looks like this:
x123yx456yx543y and so on...
I run a LIKE query when the form loads to determine the state of
control CheckBox indicating if the user has checked the record:
If Forms!myFrmName.CheckList Like "*x" & UserID & "y*" Then
Forms!myFrmName.CheckBox = True
Else
Forms!myFrmName.CheckBox = False
End If
I run a string of code to remove the x[UserID]y string from field
Checklist if the current user unchecks the control CheckBox.
So far so good.
The system works fine, but now I want to include another variable, so
that the
string would go like this:
x[UserID]y[OneorTwoDigitNumber]z
The field would look like this:
x123y3zx456y14zx543y7z and so on...
So here's the question...
I can still search for Forms!myFrmName.CheckList Like "*x" & UserID &
"y*" to check or uncheck the CheckBox control.
But how do I extract:
Forms!myFrmName.CheckList Like "*x" & UserID & "y" & ?? & "z*"
I will know "x123y" but how can I determine what follows "y" before
"z"?
(I know this could be done by creating a table creating a new record
linking users and records in the old table, but I want to stick with
this system for this particular use...)
Any help is appreciated...
lq