Okay so I'm having trouble getting my list box on my subform to populate properly when the parent form is opened. I have a "Form Load" event as follows:
Code:
Private Sub Form_Load()
Dim strSQL As String
strSQL = "SELECT tblContacts.[ContactID], ([LastName] & "", "" & [FirstName]) AS FullName, tblContacts.[Title], tblContacts.[fkOriginatorID] FROM tblContacts WHERE ((tblContacts.[fkOriginatorID]=Me.Parent.[OriginatorID])) ORDER BY ([lastname] & "", "" & [Firstname]);"
Me.[tblContacts Query subform].Form!lbContacts.RowSource = strSQL
End Sub
This works, however when the form is loading it prompts me for a value for Me.Parent.OriginatorID. The goal here would be it did this w/o prompting the user.
My second issue is I'm trying to get the fields above the listbox to update based on the selection of the listbox "On Click" event. Currently instead of reopening the subform with the updated information it is instead opening a second instance of the form in the background.
Code:
Private Sub lbContacts_Click()
DoCmd.OpenForm "fsubContacts", , , "[ContactID] =" & Me.lbContacts
End Sub
The desired outcome here would be the fields above populate on click.
I've attached a test database for reference. Database7 (2).zip