If Me.LocationsBO1.Seek("LocationID=" & .POLocationID) Then e.Values(3).DisplayValue = Me.LocationsBO1.LocationName End If
If Me.ProcessBO1.Seek("ProcessID=" & .POProcessID) Then e.Values(2).DisplayValue = Me.ProcessBO1.ProcessName End If
It's MUCH faster ;-)
Let me know if you think there is a more efficient approach. Thanks!
With DirectCast(e.BusinessObject, PurchaseOrdersBO)
Using loBO As New LocationsBO loBO.FillByLocationID(.POLocationID) e.Values(3).DisplayValue = loBO.LocationName End Using
Using loBo As New ProcessBO loBo.FillByProcessID(.POProcessID) e.Values(2).DisplayValue = loBo.ProcessName End Using
End With
My only concern is that I am making a round trip to the database twice per row, which depending on the number of records returned seems to significantly impact performance. So I'm going to noodle with a way to make it faster.
I've thought about dropping copies of the Location and Process BO on the form and fill them on FormLoad... then I can just lookup the information based on a BO that has already been filled. Now I just need to figure out how to query filled BOs. :-)
Sometimes the hardest part is knowing WHERE to look. ;-) Thanks for taking the time to point me in the right direction.