AlexMayle
AlexMayle

Reputation: 303

How to get Access to stop enforcing a one-to-many relationship

I have a form containing a bunch of time sheet entries. Now most of these entries are related to some kind of "job" we have running through the shop, but not always. When there is, you just pop the job ID into the corresponding time sheet entry and a lot of relevant information about the job is displayed - which is necessary.

However, my problem occurs when a time sheet entry DOES NOT relate to a specific job. I still want to use the same form and mechanisms to input the entry, but if the entry isn't supplied with a Job ID, Access tells me that it can't find a record in the Job table that corresponds with the entry. It will not let me save the record at that point.

So Jobs have a one-to-many relationship with the timesheet entries, but only when a relationship exists at all. How do I make Access not freak out when a Job ID isn't supplied? I've already checked the relationship and it is not enforcing referential integrity. Also the Job ID field is not marked as required in the time sheet entries table.

Upvotes: 1

Views: 50

Answers (1)

Brad
Brad

Reputation: 12255

Can you add a default value like "Unspecified" or "not billable" to the jobs list? Then you can maintain your referential integrity and you don't have to guess whether or not a NULL job IDis a missing real job ID or or one of these non-billable items.

Upvotes: 2

Related Questions