I have put together a db for a law firm to keep track of counterfeit
activities. There are four parent tables:
tblContact
tblTransaction
tblAction
tblFile
I have created a form, frmNewMatter, for adding new records to the db.
The form is based on tblFile and has a subform based on tblContact,
tblTransaction and tblAction. Essentially, frmNewMatter allows one to
input a new file number and the subform allows one to associate a
contact, transaction and action taken information to that file. In the
Contact section of frmNewMatter, one can either enter new contact
information or type in the tblContact primary key (an auto-number) in
the ContactID field which auto populates the contact fields on the
form. Because the pk is random and because the contact information by
its nature is incomplete (one record may only have an e-mail address
while another just a company name), I needed to include a search on the
form to allow users to search records in tblContact to determine the pk
associated with the preexisting contact. To solve this, I placed a
button on the form which opens frmSearch, a form I downloaded that
generates dynamic SQL (to search tblContact in the db) and assigns it
to a listbox on the form to show the results. I now want to be able to
create a double click event procedure which allows a user to click on a
result from the search and auto populate the form. So, I need code
which will say that on double click, enter the pk from the tblContact
and insert it in the ContactID field on the open frmNewMatter, thereby
obviating the need for a user to remember the pk and inputting it
manually. Any suggestions on the coding?