Wrox Programmer Forums
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 11th, 2008, 08:47 AM
Registered User
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL Syntax in VBA?

I'm trying to update some data from one Excel workbook to another using the Jet driver and I'm having a problem updating multiple fields.

Here is the SQL Statement:

UPDATE [Sheet1$] SET Active='Y', Act_Perf_ID='TESTID' WHERE Analyst ='TEST'

This works fine when I only update one data field, but adding a second field seems to be causing a problem. Any help would be appreciated.

Also, is it possible to query mulitple sheets using one SQL string.

Example:"SELECT * FROM [Sheet1$], [Sheet2$] WHERE [Sheet1$].Analyst='Test' AND [Sheet2$].Analyst='Test'

When I pass the string above, I keep gettting an error as well.

Thanks again.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba Consolidate Syntax grouth Excel VBA 3 September 29th, 2006 07:37 PM
Fields object syntax in VBA query stepdev Access VBA 11 March 3rd, 2006 04:53 PM
How can use sql syntax in excel vba Biggladius Excel VBA 4 October 6th, 2004 04:15 AM
help with VBA syntax jacqui Excel VBA 0 January 12th, 2004 02:08 PM
Word VBA Syntax Needed SerranoG VB How-To 4 October 28th, 2003 02:16 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.