I have been using the Form_Load event with the following code.
The Values of Me.MatterIdFld and Me.ClientIdFld are set using openargs and their values for this exercise are 0
I have tried using the code using the Form_Open event
When I trace through the code after breaking at the first line in the event as both variables = 0 I want to set the RecordSource to "APLoginActionTasksQry" it happens and then set the Me.filter= "UserId = " & Me.UserIdFld and this works
BUT straight after that line it goes to the Form_Load Event???
Not sure what I can do
Any help will be appreciated
The Values of Me.MatterIdFld and Me.ClientIdFld are set using openargs and their values for this exercise are 0
I have tried using the code using the Form_Open event
Code:
Dim strOpenArgs() As String
If Not IsNull(Me.OpenArgs) Then
strOpenArgs = Split(Me.OpenArgs, ";")
Me.[MatterIdFld].Value = Val(strOpenArgs(0))
Me.[ClientIdFld] = Val(strOpenArgs(1))
Else
Me.ClientIdFld = 0
Me.MatterIdFld = 0
End If
'MsgBox "MatterIdFld = " & Me.MatterIdFld
' If Me.MatterIdFld and Me.ClientIdFld = 0 then use the Login qry
If Me.MatterIdFld > 0 Then
Me.RecordSource = "APMatterActionTasksQry"
Me.Filter = "MatterId = " & Me.MatterIdFld
Me.FilterOn = True
'MsgBox "Using APMatterActionTasksQry"
Else
If Me.ClientIdFld = 0 Then
Me.RecordSource = "APLoginActionTasksQry"
Me.Filter = "UserId = " & Me.UserIdFld
Me.FilterOn = True
'MsgBox "Using APLoginActionTasksQry"
Else
Me.RecordSource = "APClientActionTasksQry"
Me.Filter = "ClientId = " & Me.ClientIdFld
Me.FilterOn = True
'Me.Filter = "ClientId = " & Me.ClientId
Me.Requery
'MsgBox "Using APClientActionTasksQry"
End If
End If
When I trace through the code after breaking at the first line in the event as both variables = 0 I want to set the RecordSource to "APLoginActionTasksQry" it happens and then set the Me.filter= "UserId = " & Me.UserIdFld and this works
BUT straight after that line it goes to the Form_Load Event???
Not sure what I can do
Any help will be appreciated