Pete456
02-06-2002, 06:14 PM
I have created an Access database with a form that will automatically place data in a field based upon the entry from another field. I used a subform for the automatic data. The data enters into the form okay and into the report but the automatic data will not be saved in the table--The automatic data I want entered into the table is an address based upon an enterd name from a combo box. any ideas why this happens and how to solve t??--
Since you already have the address stored in a table you don't need to store it again in another.
Pete456
02-07-2002, 04:28 PM
That may be true, but it still doesn't answer the question of why the information won't appear in the table after I select and enter it in the associated form. All other data (combo box and entered data) appears correctly in the Table-- except the subform selected data--
Fizzio
02-08-2002, 01:24 AM
As Rich says, avoid duplication of data.
Instead of storing it again, base your combobox on a query and add all the fields you want to display in the subform.
In the subform, set up unbound txtboxes for the fields you want to show and directly reference the combobox data.
If for example columns are as this in the combo
ID | Name | Address1 | etc,
in your txtAddress1 box in the subform, set the controlsource to =Forms!MainForm!NameofCombo.Column(2)
It will then show the address but not store it again. In the table that supplies the subform, set up a FK linked to the PK in your mainform table.
Hope this makes sense and is useful
Pat Hartman
02-08-2002, 04:55 AM
The answer to the question "why the information won't appear in the table", is that only bound controls will update the form's recordset automatically. If the control source is "=anything", the control is not bound.
Pete456
02-08-2002, 06:59 PM
Rich, Fizzio and Pat--Thanks for the information--I thought about a querry for the subform when I was designing this database and that may solve the problem--
problem is I have used Access quite a bit but never attempted subforms and obviously don't understand the structure yet--
Is there a major differnce between Access 97 and later versions that would make data design of this sort easier??-- Thanks