By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,915 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

Append Query Syntax Question

P: n/a
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

Aug 22 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In article <11**********************@q4g2000prc.googlegroups. com>,
so*********@yahoo.com says...
SELECT tblCalls.Caller_Name
FROM Calls

See anything wrong there?
Aug 22 '07 #2

P: n/a
Good catch but it still doesn't work (?)
I changed it to the below:

INSERT INTO tblCalls ( Caller_Name )
SELECT tblCalls.Caller_Name
FROM tblCalls
WHERE (((tblCalls.Caller_Name)=[Forms]![frmCustDetail]!
[txtCaller_Name]));
On Aug 22, 3:29 pm, Mike Gramelspacher <grame...@psci.netwrote:
In article <1187807925.439927.244...@q4g2000prc.googlegroups. com>,
soljshav...@yahoo.com says...SELECT tblCalls.Caller_Name
FROM Calls

See anything wrong there?

Aug 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.