kysterathome
Technical User
Hi All,
I am looking for a solution for a lookup funtion and hope s.o. has an idea.
What I got:
A main form with meetings (frmMeetings)
A subform with Attendees (subfrmAttendees) - a continuous Form that has buttons next to each name entry, one of which is Cmd Button NameLookup that launches frmSearchContact
Objective:
Populate the sbfrmAttendees with names selected from a tblContacts
Tool:
frmSearchContact allows the user to look up Attendees according to certain criteria (e.g. CompanyName, LastName) from tblContacts and returns a list of names into a listbox (lstCustInfo) This I got. Upon double-clicking on any given name in this results list, as it is now, it opens the main subfrmAttendees but doesn't popluate the last field in the particular meeting I want it to. This is the last code, I believe that will be relevant:
Upon double clicking the name in the list box, I would like to return to the frmMeetings (as opposed to re-openening it, I guess) at the place where I left it (at that particular meeting when I first opened the frmSearchContact) and have the empty field in subfrmAttendees be populated with the result I clicked on.
But ... how do I do that? I am a beginner in coding, hence a maybe simple question... (silently hoping)
I would be grateful for any indication you may have
Kysterathome
I am looking for a solution for a lookup funtion and hope s.o. has an idea.
What I got:
A main form with meetings (frmMeetings)
A subform with Attendees (subfrmAttendees) - a continuous Form that has buttons next to each name entry, one of which is Cmd Button NameLookup that launches frmSearchContact
Objective:
Populate the sbfrmAttendees with names selected from a tblContacts
Tool:
frmSearchContact allows the user to look up Attendees according to certain criteria (e.g. CompanyName, LastName) from tblContacts and returns a list of names into a listbox (lstCustInfo) This I got. Upon double-clicking on any given name in this results list, as it is now, it opens the main subfrmAttendees but doesn't popluate the last field in the particular meeting I want it to. This is the last code, I believe that will be relevant:
Code:
'Pass the SQL to the RowSource of the listbox
Me.lstCustInfo.RowSource = strSQL & " " & strWhere & "" & strOrder
End Sub
Private Sub Form_Open(Cancel As Integer)
End Sub
Private Sub lstCustInfo_DblClick(Cancel As Integer)
'Open frmAttendees based on the ID from lstCustInfo listbox
DoCmd.OpenForm "ContactsForm", , , "[ID] = " & Me.lstCustInfo
Upon double clicking the name in the list box, I would like to return to the frmMeetings (as opposed to re-openening it, I guess) at the place where I left it (at that particular meeting when I first opened the frmSearchContact) and have the empty field in subfrmAttendees be populated with the result I clicked on.
But ... how do I do that? I am a beginner in coding, hence a maybe simple question... (silently hoping)
I would be grateful for any indication you may have
Kysterathome