By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

A2k - records on many side appearing spontaneously - help!

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.