|
Axle100 (Programmer) |
11 Feb 09 3:34 |
I am trying to read the results of DDQ form. I can open the form, enter search data and execute it. I can then execute the command to view the detail. The detail view is displayed but I can not read or control any data or commands on the form.
Any assistance is greatly appreciated. Below is the code I have thus far...
Dim objDDQ541 As ddq541.MimsApplication Dim iRow As Integer Dim strReqID As String Dim strReqDesc As String Dim frm As Object Dim cmd As Object Dim ind As Object Set objDDQ541 = New ddq541.MimsApplication objDDQ541.Session.Login 1, fasle objDDQ541.New objDDQ541.ActivateDefaultView iRow = 2 Do While Worksheets(2).Cells(iRow, 1).Value objDDQ541.SearchView.Inputs(0, "EquipRef") = Worksheets(2).Cells(iRow, 2).Value objDDQ541.SearchView.Inputs(0, "Status") = "U" objDDQ541.SearchView.Inputs(0, "Classification") = "EF" objDDQ541.SearchView.Inputs(0, "SearchMethod") = "A" objDDQ541.SearchView.StartSearch 'Go through the results For i = 0 To objDDQ541.SearchView.OutputInstances - 1 Worksheets(2).Cells(iRow, 12).Value = Worksheets(2).Cells(iRow, 12).Value & objDDQ541.SearchView.Outputs(i, "RequestId") & " - " & objDDQ541.SearchView.Outputs(i, "RequestIdD1") & Chr(10) 'Debug.Print objDDQ541.SearchView.OutputNames(i) & "= " & objDDQ541.SearchView.Outputs(i, objDDQ541.SearchView.OutputNames(i)) objDDQ541.SearchView.Activate Set cmd = objDDQ541.Commands.Item("detail") cmd.Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID") 'objDDQ541.Commands.Item("detail").Inputs(0, "RequestId") = objDDQ541.SearchView.Outputs(i, "RequestID") cmd.Modeless = True 'objDDQ541.Commands.Item("Detail").Modeless = True cmd.Execute 'objDDQ541.Commands.Item("Detail").Execute Set frm = objDDQ541.DetailViews.Item(0) frm.Activate objDDQ541.DetailViews.Item(0).Activate 'Search Command objDDQ541.Commands.Item("search").Modeless = True 'objDDQ541.Commands.Item("search").Inputs(0, "RequestId") = "" 'objDDQ541.Commands.Item("search").Inputs(0, "Location") = "" objDDQ541.Commands.Item("search").Inputs(0, "EquipRef") = objDDQ541.SearchView.Outputs(i, "RequestID") 'objDDQ541.Commands.Item("search").Inputs(0, "EquipNo") = "" objDDQ541.Commands.Item("search").Execute Next i iRow = iRow + 1 Loop 'EnumObject objDDQ541 'Read the data to see what is there 'EnumCommands objDDQ541 For i = 0 To objDDQ541.Commands.Item("detail").OutputNameCount - 1 'Debug.Print objDDQ541.Commands.Item("Search").OutputNames(i) & " = " & objDDQ541.Commands.Item("Search").Outputs(0, objDDQ541.Commands.Item("Search").OutputNames(i)) Debug.Print objDDQ541.Commands.Item("Detail").OutputNames(i) & " = " & objDDQ541.Commands.Item("Detail").Outputs(0, objDDQ541.Commands.Item("Detail").OutputNames(i)) 'Debug.Print objDDQ541.Commands.Item("Search").InputNames(i) & " = " & objDDQ541.Commands.Item("search").Inputs(1, objDDQ541.Commands.Item("search").InputNames(i)) 'Debug.Print cmd.OutputNames(i) & " = " & cmd.Outputs(i, cmd.OutputNames(i)) Next i
objDDQ541.Quit ClearObject objDDQ541 '***********
Cheers,
Alex |
|