Subform problem

T

todd

I keep getting an error message saying I cannot add or
change a record because a related record is required in
table1.

I've got table1 and table2 and the relationship is one to
one just because table2 will only hold notes on each
record in table1 and each record in table1 only needs one
record for notes. The reason for the notes being in a
separate table is because table1 appears in datasheet view
on the form and this is a form/subform setup.

The related fields in the two tables are for table1
(autonumber) and table2 (autonumber). Is the related
numbers the cause for the problem? Help!
 
T

tina

-----Original Message-----
I keep getting an error message saying I cannot add or
change a record because a related record is required in
table1.

I've got table1 and table2 and the relationship is one to
one just because table2 will only hold notes on each
record in table1 and each record in table1 only needs one
record for notes. The reason for the notes being in a
separate table is because table1 appears in datasheet view
on the form and this is a form/subform setup.

The related fields in the two tables are for table1
(autonumber) and table2 (autonumber). Is the related
numbers the cause for the problem? Help!
.
table1 is your parent table, autonumber as primary key is
okay.
table2 is your child table, primary key should be Number,
Long Integer (to match the parent table's primary key) but
should NOT be an autonumber.

fyi, if you expect a small percentage of the records in
the parent table to require notes, a child table makes
sense. if most or all records will require notes, you do
have another option. you can keep the notes field in the
main table, and set the notes control in the form to open
a Zoom box (on Click or Right Click, for instance) to
allow the user to see more of the text during data entry
or review, as

Private Sub TextControl_Click()
RunCommand acCmdZoomBox
End Sub
 
T

Todd

I used the Zoom command you suggested but when I enter
data in the box and close it and then try to open that
record back up to see what I typed for that record nothing
appears in it. Nothing appears in the underlying table
for that record either. What am I doing wrong?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top