Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform Error Message 1

Status
Not open for further replies.

tdenny

MIS
Jul 5, 2001
5
US
Hello

My small database has two tables ActionItems and Status comments. These tables are linked Primary Key and Foreign Key together. I have a main form and a subfom that displays the status comments which could be many. I would like to be able to add new status comments to the form regularly. When I start typing in the next row of the suform (datasheet mode) I get this error message:

You can't assign a value to this object

* the object may be a control on a read only form
* The object may be on a form that is open in design view.
*The value may be too large for this field.

I don't have either form made to be read only, no other form is open at the same tme, and the field I'm updating is a text field (255).

I set the control source of the subform key = to the main form ID number and it shows up that way in my subform. Does anybody have any ideas on how I can add records to the subform.
 
> I set the control source of the subform key = to the main >form ID number


I've reproduced your error.
The control source of the subform key should be the field in the *table* the subform is based on.

Go back to the subform design, use the dropdown list that appears when you select the control source. This should be a list of the fields in the table. Select the key field.

FYI: Look at your Form/Subform in design view. Check the Data Properties of your SubForm Control. You should see Link Child Fields, Link Master Fields properties. That's where the link between your form and subform is created. They should reference your primary and foreign key fields.


HTH

 
SKO,

Thanks much for your response. It worked very well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top