Write a record to a table by double-clicking a record selector in a datasheet form

SteveL13
SteveL13 used Ask the Experts™
on
I am trying to write a record to a table by double-clicking a record selector in a datasheet form.  But for some reason it is only writing the first record in the list rather that the one I am double-clicking on.  Here is the SQL of the append table query:  (Can someone tell me what I'm doing wrong?)

INSERT INTO tblCustomerAutoNotes ( Document, [Section], NoteCopyDD, NoteCopy, ForeColor, CustomerID, CustAutoNote )
SELECT tblEstimateNotes.Document, tblEstimateNotes.Section, tblEstimateNotes.NoteCopyDD, tblEstimateNotes.NoteCopy, tblEstimateNotes.ForeColor, [Forms]![frmEstimates]![cboCustomerID] AS CustomerID, tblEstimateNotes.CustAutoNote
FROM tblEstimateNotes
WHERE (((tblEstimateNotes.NotesID)=[Forms]![frmEstimates].[Form]![frmEstimateNotes].[Form]![txtNotesID]));

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014
Commented:
Are you sure this is pointing to the correct value for NotesID:

[Forms]![frmEstimates].[Form]![frmEstimateNotes].[Form]![txtNotesID]

Are you working with subforms? If not, then I'd think it would be

[Forms]![frmEstimates].[txtNotesID]

Author

Commented:
You are correct.  It is a subform.  And thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial