C
Chris Belcher
The large bleeding bump on my forehead is from beating my head on the wall.
I have a form with 3 subforms.. In add mode I enter the main form
information then go to an unbound combo box and select a detail scope.
Using the OnChange event I open an "Add Scope form" that shows the
selected scope and displays 2 buttons "Add Scope" and "Cancel" Pressing
the "Add Scope button runs a macro that opens an append query that
writes the scope data to the detail table. Or at least thats how it's
suppose to work....
I get "Can't append all records" and goes on to say that there were (n)
key violations. After a head banging session I figure out that if I go
to the next record and back the append works. I'll not bore you with the
details but I've tried save, next record, previous record, requery, and
closing the form after I get the scope form up and get the necessary
values stored in unbound text boxes. Each of these result in some type
of error.
What I think is happening here is, while I'm putting the master table
information in, the data is not stored in the master table until I go to
the next record. (I get a pencil on the record selector until then).
[AI Key] is the primary key and is a calculated field set with a default
value that is in the "default value" property for that field. Until I go
to the Next record the Master table records don't exist except on the
form. The Append query is attempting to add detail, using a FK that does
not yet have a PK, so it sets the Key violations.
Am I correct? If so, Is there a way to get Access to push that data into
the Master Table before I start adding the detail.
What am I missing?
Any Help would be appreciated.
I have a form with 3 subforms.. In add mode I enter the main form
information then go to an unbound combo box and select a detail scope.
Using the OnChange event I open an "Add Scope form" that shows the
selected scope and displays 2 buttons "Add Scope" and "Cancel" Pressing
the "Add Scope button runs a macro that opens an append query that
writes the scope data to the detail table. Or at least thats how it's
suppose to work....
I get "Can't append all records" and goes on to say that there were (n)
key violations. After a head banging session I figure out that if I go
to the next record and back the append works. I'll not bore you with the
details but I've tried save, next record, previous record, requery, and
closing the form after I get the scope form up and get the necessary
values stored in unbound text boxes. Each of these result in some type
of error.
What I think is happening here is, while I'm putting the master table
information in, the data is not stored in the master table until I go to
the next record. (I get a pencil on the record selector until then).
[AI Key] is the primary key and is a calculated field set with a default
value that is in the "default value" property for that field. Until I go
to the Next record the Master table records don't exist except on the
form. The Append query is attempting to add detail, using a FK that does
not yet have a PK, so it sets the Key violations.
Am I correct? If so, Is there a way to get Access to push that data into
the Master Table before I start adding the detail.
What am I missing?
Any Help would be appreciated.