records being overwritten

J

jem53

hello,
i have a simple 2 table database.

tbl_1 plant ID # (primary)
genus
species
accession date

tbl_2 journal ID # (primary)
plant ID # (lookup from tbl_1)
date
description

i have a sub form based on query of tbl_2 and main form
based on tbl_1 (many to one)

when the user selects the plant id# from the main form the
sub form displays all records related to that plant (in
data sheet view)+ new record entry line.

problem is when a new record is entered in the subform the
records in the underlying table are being changed and
added incorrectly.

any ideas?

jem
 
J

John Vinson

i have a sub form based on query of tbl_2 and main form
based on tbl_1 (many to one)

when the user selects the plant id# from the main form the
sub form displays all records related to that plant (in
data sheet view)+ new record entry line.

problem is when a new record is entered in the subform the
records in the underlying table are being changed and
added incorrectly.

How "incorrectly"? What's the Recordsource of the subform? What's its
Master/Child Link Field?
 
J

jem53

the record source of the subform is tbl_2.
'incorrectly' is difficult for me to explain. but let me
try. i noticed that when a new data was entered for (lets
call it) plant A the new data was entered into plant A's
record in tbl_2 but an existing record for plant A would
be removed. the missing record for plant A seemed to be
rewritten into Plant Z's record (with plant Z's Id number
but plant A's data) in tbl_2.
i think i just confused my self more than ever. hope you
understand!
jem
 
J

jem

-----Original Message-----


How "incorrectly"? What's the Recordsource of the subform? What's its
Master/Child Link Field?


.
john, i forgot to include the master/child link field.
it is plant ID
 
J

John Vinson

the record source of the subform is tbl_2.
'incorrectly' is difficult for me to explain. but let me
try. i noticed that when a new data was entered for (lets
call it) plant A the new data was entered into plant A's
record in tbl_2 but an existing record for plant A would
be removed. the missing record for plant A seemed to be
rewritten into Plant Z's record (with plant Z's Id number
but plant A's data) in tbl_2.

It sounds like you may be intending to navigate to a record on the
mainform, but are in fact overwriting the data. Do you have a Plant
combo box on the mainform? Are you selecting PlantA to edit the
subform using the combo? If it's a bound combo box, that will just
overwrite PlantA's ID with PlantZ's.
 

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