help needed, brain gone!

It must be a linking problem.
And Pat Hartman suggested that already in post #8 so assume he already checked that. If not, it definitely needs to be verified. Very easy to do.
 
It must be a linking problem.

If you have a subform with Multiple records then the linking PK/FK autopopulate as in the following example:-
If you then delete a record then the PK will autopopulate with (New) and the FK will populate when you enter the first Data in a Control.
i completly agree mike the word new should be in the new record but using sql the word new dosnt show up what i usually see on other forms is the id field staying empty untill the record is saved, and this form does do that perfectly untill you try adding a record after the delete, im going to have another little play with it today so fingers crossed
 
Then it wasn't actually correct;) Or, perhaps it was "correct" code but in the wrong event so it wasn't being executed when you thought it would/should be.

That means the record isn't actually being deleted. Why? Is the form bound to a query that includes a join to a second table? If so, the delete action works against the child table, not the parent table. You need to split into a form/subform.

The 3101 error can be caused in two situations that I am aware of.
1. The master/child links are not correctly set so Access isn't populating the FK for you.
2. Your subform is joined to the main form record (it shouldn't be) and instead of selecting the FK field from the child record, you selected the PK field from the parent record.

If you can isolate the forms and tables related to this issue in a separate database, we have a better shot at figuring out the problem.
thank you for this pat i will look into this now and see if i cant simplfy thing a little.
 
@Pat Hartman took on board what you said and rechecked the record set for the sub qry, made a slight change and removed one of the tables that wasnt critical and it works perfecly , very strange,. but done thank you .
 

Users who are viewing this thread

Back
Top Bottom