Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 22nd, 2007, 07:45 PM
SolomonShavitzMetsFan
Guest
 
Posts: n/a
Default Append Query Syntax Question

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

  #2  
Old August 22nd, 2007, 08:35 PM
Mike Gramelspacher
Guest
 
Posts: n/a
Default 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?
  #3  
Old August 22nd, 2007, 08:55 PM
SolomonShavitzMetsFan
Guest
 
Posts: n/a
Default 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?

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles