MajP
You've got your good things, and you've got mine.
- Local time
- Yesterday, 20:47
- Joined
- May 21, 2018
- Messages
- 9,015
I added some simple formatting to make this visibly understandable. It stacks the pop ups and spaces them.
Code:
Public Function OpenAClient(PartyID As Long, FormName As String)
'Purpose: Open an independent instance of a form.
'Open a new instance, show it, and set a caption.
Dim frm As Form
Select Case FormName
Case "frmPersons"
Set frm = New Form_frmPersons
frm.ConfigureForm ftDrillDown
frm.Move 700 * clnClient.Count + 1, 1000 * clnClient.Count + 1, 1440 * 10, 1440 * 7
frm.txtTitle.Caption = "Drill Down to Related Person: " & GetNameFromID(PartyID)
frm.txtTitle.FontBold = True
frm.txtTitle.ForeColor = vbBlack
Case "frmOrganisations"
Set frm = New Form_frmOrganisations
End Select
frm.Visible = True
frm.Caption = frm.hWnd & ", opened " & Now()
frm.Filter = "PartyID = " & PartyID
frm.FilterOn = True
'Append it to our collection.
clnClient.Add Item:=frm, Key:=CStr(frm.hWnd)
TempVars!Drilldown = "yes"
Set frm = Nothing
End Function
Public Function GetNameFromID(PartyID As Long) As String
GetNameFromID = Nz(DLookup("[CurrentTitle] & ' ' & [CurrentFirstName] & ' ' & [CurrentlastName]", "tblPerson", "PartyID = " & PartyID), "")
End Function