| Hello all, 
 is it normal to have a situation where the same MainView (eg Contact Detail) is open more than once?
 
 I have a different View that can be called from the "Insert" menu, and then looks through all open MainViews to find a CONTACT main view.  The problem is that when two of them are up at the same time, it finds the first one, which may not be the one the user expected.
 
 Basically, my "add new Contact Service" form has a WhenInsertNewContactService() function, so when it's opened it can try and find out which contact to default to.
 
 
 
 ' Scan through the open MainViews and see if there's an active Contact
 Dim objMainViews
 Set objMainViews = Application.MainViews
 Dim i
 For i = 0 To objMainViews.Count - 1
 If objMainViews.Item(i).BaseTable = "CONTACT" Then
 uxContact.LookupID = objMainViews.Item(i).CurrentID
 uxContact.Text = GetField("NAMELF", "CONTACT", "CONTACTID='" & uxContact.LookupID & "'")
 ElseIf objMainViews.Item(i).BaseTable = "SERVICE" Then
 uxService.LookupID = objMainViews.Item(i).CurrentID
 uxService.Text = GetField("SERVICENAME", "SERVICE", "SERVICEID='" & uxService.LookupID & "'")
 End If
 Next
 
 uxContact and uxService are lookup fields on the form that point to a CONTACT and a SERVICE.
 
 I suppose I could use application.BasicFunctions.CurrentContactID, but what's the general case for multiple instances of the same view?
 
 Thanks,
 
 Mark
 
 |