First, here's my code that doesn't work:
The OpenArgs string would be built like this:
The highlighted line shows what I'm trying to do, but this doesn't work as written. With my current OpenArgs string, it should execute something like:
Can someone tell me how I can do something similar, or perhaps an even better way of accomplishing the same thing?
Thanks..
-Sparky
Code:
Private Sub Report_Open(Cancel As Integer)
Dim Args() As String
Dim ControlName As String
Dim Property As String
Dim Value As String
Dim ThisArg() As String
If Not IsNull(Me.OpenArgs) Then
Args = Split(Me.OpenArgs, ";")
For Each Arg In Args
ThisArg = Split(Arg, "|")
ControlName = ThisArg(0)
Property = ThisArg(1)
Value = ThisArg(2)
[B]Me.Controls(ControlName).Property = Value[/B]
Next Arg
End If
End Sub
The OpenArgs string would be built like this:
Code:
strOpenArgs = "lblReportTitle|Caption|Test;"
The highlighted line shows what I'm trying to do, but this doesn't work as written. With my current OpenArgs string, it should execute something like:
Code:
lblReportTitle.Caption = "Test"
Can someone tell me how I can do something similar, or perhaps an even better way of accomplishing the same thing?
Thanks..
-Sparky