G
Guest
Hello,
I am using Access 2003. I have continuous 3 subforms, all bound to the same
table. I am filtering each subform on a hidden field, EyeColor, in the table:
TABLE:
OccupationID Name EyeColor
1 Jim Blue
2 Joe Green
3 Sally Blue
4 Brigid Brown
Of my three subforms, one subform filters to show only Blue EyeColor,
another only Green EyeColor, and the third only Brown EyeColor
So I have something like:
Continuous Subform - Blue:
1 Jim <delete button>
3 Sally <delete button>
Continuous Subform - Green:
2 Joe <delete button>
Continuous Subform - Brown:
4 Brigid <delete button>
Occupation is set up as a combobox on each of the 3 subforms, and is
pre-populated with a list of all possible OccupationIDs, 1-10. This means I
can only have a total of 10 records in the table. OccupationID is my primary
key in the table, and has to remain that way, as there can only be one
person per occupation. However, you can change occupation.
My problem is, on any subform, I can add a new row, since they are all
continuous subforms. When I do this, if I pick an OccupationID from the
combobox that already exists in tthe table (I already have 10 records in the
table), the application warns me of a primary key violation and that I must
pick another OccupationID. But if all Occupation IDs are taken, and the
OccupationID combobox only has 1-10 in its list, I cannot set the combobox to
any value that doesn't violate the primary key integrity, and I get stuck in
a loop where clicking the <delete button> does not work, and trying to leave
the subform just prompts the primary key violation pop-up.
In a nutshell (a large nutshell), I already have 10 records. I add another
one (shouldn't be able to but it's a continuous form so i can). The current
record, the one I just added, cannot be set to any Occupation ID that does
not violate the primary key rule, and when I'm in this state, since they're
all "taken", and clicking the delete button has no effect (not sure why).
Sorry if this is confusing.
Any ideas?
Thanks,
Scott
I am using Access 2003. I have continuous 3 subforms, all bound to the same
table. I am filtering each subform on a hidden field, EyeColor, in the table:
TABLE:
OccupationID Name EyeColor
1 Jim Blue
2 Joe Green
3 Sally Blue
4 Brigid Brown
Of my three subforms, one subform filters to show only Blue EyeColor,
another only Green EyeColor, and the third only Brown EyeColor
So I have something like:
Continuous Subform - Blue:
1 Jim <delete button>
3 Sally <delete button>
Continuous Subform - Green:
2 Joe <delete button>
Continuous Subform - Brown:
4 Brigid <delete button>
Occupation is set up as a combobox on each of the 3 subforms, and is
pre-populated with a list of all possible OccupationIDs, 1-10. This means I
can only have a total of 10 records in the table. OccupationID is my primary
key in the table, and has to remain that way, as there can only be one
person per occupation. However, you can change occupation.
My problem is, on any subform, I can add a new row, since they are all
continuous subforms. When I do this, if I pick an OccupationID from the
combobox that already exists in tthe table (I already have 10 records in the
table), the application warns me of a primary key violation and that I must
pick another OccupationID. But if all Occupation IDs are taken, and the
OccupationID combobox only has 1-10 in its list, I cannot set the combobox to
any value that doesn't violate the primary key integrity, and I get stuck in
a loop where clicking the <delete button> does not work, and trying to leave
the subform just prompts the primary key violation pop-up.
In a nutshell (a large nutshell), I already have 10 records. I add another
one (shouldn't be able to but it's a continuous form so i can). The current
record, the one I just added, cannot be set to any Occupation ID that does
not violate the primary key rule, and when I'm in this state, since they're
all "taken", and clicking the delete button has no effect (not sure why).
Sorry if this is confusing.
Any ideas?
Thanks,
Scott