I am writing for lack of a better word a "mini program" within a form
that does a lot of other things and is a bound form for other
purposes. The form (frmCustDetail) is bound to another table
("tblCalls")than that to which I want to write. I want to have a
button that is called "AddCalls" like below that calls an append query
that opens a new record for a "Call" being made. This table with the
calls just has a Call_ID field (the key field, which is auto-numbered)
and the name of the caller (Caller_Name). The name of the caller is
picked up from the main form within a textbox called "txtCaller_Name".
So the below is all I think I need to call the append query with my
button:
Private Sub AddCall_Click()
Dim stDocName As String
stDocName = "appendCalls"
DoCmd.OpenQuery stDocName, acNormal, acEdit
End Sub
But what is puzzling me is how to word the append query. Here's what I
have tried without it working:
INSERT INTO tblCalls ( Caller_Name )
SELECT tblCalls.Caller_Name
FROM Calls
WHERE (((Calls.Caller_Name)=[Forms]![frmCustDetail]!
[txtCaller_Name]));
Any ideas?
Thanks! Sol Shavitz