I
Intrepid_Yellow
Greetings all,
So here’s relevant information about my database.
Form (frmCompany_Management) has a combo box to select a company name, this
then shows the details for the chosen company. The company name is displayed
in a text box (txtCompany_Name). There is a button (btnContactDetails) that
loads a form (frmContact_Details). This form has within it a Sub form
(subfrmContact_Details) to display a table with all contacts associated with
the relevant company. Company names are stored in a field called Company_Name
in table (tblCompany_Details) for the Company Management form and then the
sub form refers to table (tblContact_Details) which has the same Company_Name
field (which has a relationship to the other Company_Name field).
And here’s what I want to happen.
When the button is clicked and the Contact Details form is opened I need to
read the Company Name from the text box in the Company Management form and
only display the relevant contacts in the datasheet sub form.
And what exactly do I need?
The one or two lines of code to read the name and only show the relevant
contacts and where exactly to put this piece of code (eg ‘On Click’ of
button, ‘On Load’ for the subform etc). I have some idea of what I need but
can’t seem to get it working.
Anyones help would be appreciated. Thanks.
So here’s relevant information about my database.
Form (frmCompany_Management) has a combo box to select a company name, this
then shows the details for the chosen company. The company name is displayed
in a text box (txtCompany_Name). There is a button (btnContactDetails) that
loads a form (frmContact_Details). This form has within it a Sub form
(subfrmContact_Details) to display a table with all contacts associated with
the relevant company. Company names are stored in a field called Company_Name
in table (tblCompany_Details) for the Company Management form and then the
sub form refers to table (tblContact_Details) which has the same Company_Name
field (which has a relationship to the other Company_Name field).
And here’s what I want to happen.
When the button is clicked and the Contact Details form is opened I need to
read the Company Name from the text box in the Company Management form and
only display the relevant contacts in the datasheet sub form.
And what exactly do I need?
The one or two lines of code to read the name and only show the relevant
contacts and where exactly to put this piece of code (eg ‘On Click’ of
button, ‘On Load’ for the subform etc). I have some idea of what I need but
can’t seem to get it working.
Anyones help would be appreciated. Thanks.