The code that follow could be use in many occasion :
Don't know if there's a better solution but that one works well, so if you want to pass more than one Argument to a form when you open it.
'In the On_Click Event of the button that open the form
arg1
arg2
arg3
now there's some code to separate the arguments in the form you just open
'In the On_Open event of the form you want to open
'Could be anything (be aware that if you use a Letter it could cause so problem.)
'change the 40 to what you want
'No Delim so there's just a word
so after that, each arguments are separated.
hope that help
jul ^_^
Don't know if there's a better solution but that one works well, so if you want to pass more than one Argument to a form when you open it.
'In the On_Click Event of the button that open the form
Code:
Dim stOpenArgs as string
Dim Delim as String
Delim = " "
stOpenArgs = "
Code:
" & Delim & "
Code:
" & Delim & "
Code:
"
DoCmd.OpenForm "theForm",,,,,,stOpenArgs
'In the On_Open event of the form you want to open
Code:
Dim stOpenArgs As String
Dim Delim As String
Delim = " "
Code:
If Not IsNull(Me.OpenArgs) Then
stOpenArgs = Me.OpenArgs
Dim Args(40) As String
Code:
Dim cpt As Integer
cpt = 0
Dim position
While Len(stOpenArgs)
position = InStr(stOpenArgs, Delim)
If position = 0 Then
Code:
Args(cpt) = stOpenArgs
stOpenArgs = ""
Else
Args(cpt) = Left(stOpenArgs, position - 1)
stOpenArgs = Right(stOpenArgs, Len(stOpenArgs) - position)
cpt = cpt + 1
End If
Wend
End If
hope that help
jul ^_^