I have a form with a subform. When there are no entries in the
subform, I have an append query which makes a default entry in the
subform (for what I am doing there needs to be at least one value in
the subform).
The code in the form is this:
Private Sub Form_AfterInsert()
If Me.strWholeStr = 0 Then
DoCmd.SetWarnings False
DoCmd.OpenQuery "AddNewPart"
DoCmd.SetWarnings True
End If
End Sub
So if the user unchecks a box saying there will be no entries in the
sub form it runs the append query.
Here is the code for my append query...
INSERT INTO 4ptTable ( ptstrKey )
SELECT [strKey]
FROM 3strTable;
My problem is whenever the append query is run, it adds a record to
EVERY record in the table... not just the record I am currently working
on. there must be a way to code it so it only appends the record that
is curently being worked on.
My level of SQL is very basic so please explain any code you suggest.
Cheers!
James