foxtrot123
Registered User.
- Local time
- Today, 01:47
- Joined
- Feb 18, 2010
- Messages
- 57
I have an open args statement with three values, separated by pipes ("|").
In the on load event of a form, I need to parse out the three values as strings. The following works if there are just two arg values. How can I change it so it works with three?
In the on load event of a form, I need to parse out the three values as strings. The following works if there are just two arg values. How can I change it so it works with three?
Code:
Dim intPos As Integer
Dim strFirstArg As String
Dim strSecondArg As String
If Len(Me.OpenArgs) > 0 Then
' Position of the pipe
intPos = InStr(Me.OpenArgs, "|")
If intPos > 0 Then
' Retrieve value from the first part of the string
strFirstArg = Left$(Me.OpenArgs, intPos - 1)
' Retrieve value from the middle of the string
strSecondArg = Mid$(Me.OpenArgs, intPos + 1)
' Retrieve value from the end of the string
[COLOR=Red]* strThirdArg = ???? [/COLOR]
' Assign the values to the control
Me.FirstArg = strFirstArg
Me.SecondArg = strSecondArg
* Me.ThirdArg = strThirdArg
End If
End If
Last edited: