470,641 Members | 2,412 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,641 developers. It's quick & easy.

A2k - records on many side appearing spontaneously - help!

This is the setup;

Main form based on tblBasic (employee records).
The subform is a Single form based on tblContracts.
The forms are linked on basicID which is the primary key in tblBasic and
Foreign Key in tblContracts.

An employee *may* have more than one contract. The default is that each
employee has at least one contract.

I now realise that once I create an employee record this doesn't mean a
single related record is created in tblContracts as I would like. A record
*is* created in tblContracts but it's just empty and the FK from tblBasic is
not there.
So now I am creating a related record with the FK id using DAO.

However when i click onto the subform it automatically creates another
record (with blank basicID).

How can I stop this, and ensure I only have valid records? Each employee
should only have one Contract record to start with.
(If this can be solved then I think the rest is ok; I have code that creates
another Contract record, if the user so desires, which appears to work
fine.)

many thanks
Martin

Nov 12 '05 #1
1 1331
Deano wrote:
This is the setup;

Main form based on tblBasic (employee records).
The subform is a Single form based on tblContracts.
The forms are linked on basicID which is the primary key in tblBasic
and Foreign Key in tblContracts.

An employee *may* have more than one contract. The default is that
each employee has at least one contract.

I now realise that once I create an employee record this doesn't mean
a single related record is created in tblContracts as I would like.
A record *is* created in tblContracts but it's just empty and the FK
from tblBasic is not there.
So now I am creating a related record with the FK id using DAO.

However when i click onto the subform it automatically creates another
record (with blank basicID).

How can I stop this, and ensure I only have valid records? Each
employee should only have one Contract record to start with.
(If this can be solved then I think the rest is ok; I have code that
creates another Contract record, if the user so desires, which
appears to work fine.)

many thanks
Martin


Might be ok now, I have a delete query in the Close event (and various other
places) of the subform that clears out the empty records continuously.
Though if anyone can explain this behaviour or a better way of fixing it
please post.

thanks
Martin
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Tony Kennedy | last post: by
24 posts views Thread by Greg N. | last post: by
1 post views Thread by Charles Ledbetter | last post: by
reply views Thread by Fronky | last post: by
3 posts views Thread by Maverick6197 via AccessMonster.com | last post: by
1 post views Thread by Korara | last post: by
???
1 post views Thread by Stoney L | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.