Connecting Tech Pros Worldwide Help | Site Map

Append Query Syntax Question

SolomonShavitzMetsFan
Guest
 
Posts: n/a
#1: Aug 22 '07
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

Mike Gramelspacher
Guest
 
Posts: n/a
#2: Aug 22 '07

re: Append Query Syntax Question


In article <1187807925.439927.244250@q4g2000prc.googlegroups. com>,
soljshavitz@yahoo.com says...
Quote:
SELECT tblCalls.Caller_Name
FROM Calls
>
>
See anything wrong there?
SolomonShavitzMetsFan
Guest
 
Posts: n/a
#3: Aug 22 '07

re: Append Query Syntax Question


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:
Quote:
In article <1187807925.439927.244...@q4g2000prc.googlegroups. com>,
soljshav...@yahoo.com says...SELECT tblCalls.Caller_Name
Quote:
FROM Calls
>
See anything wrong there?

Closed Thread


Similar Microsoft Access / VBA bytes