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

You are currently viewing the Access 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 August 11th, 2005, 11:27 AM
Registered User
 
Join Date: Aug 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default asterisk escape character

hi. :)

i could do with a bit of help.

i'm trying to append some data from a query into a table via Access VBA.

the code is thus:

INSERT INTO table1 (col1, col2, ...)
SELECT (col1, col2)
FROM [query name]


the problem is that one of the columns is called 'ID*+' and the asterisk in the name is the reason it's not working... can anyone tell me a way to incorporate the asterisk without an error - perhaps with an escape character ?

i would really appreciate any help. thanks in advance,

Tom
 
Old August 11th, 2005, 12:20 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

First. Change your field name and remove the asterisk. It is not good practice.

you can do a:

SELECT [ID*] from Table1




Sal
 
Old August 11th, 2005, 02:16 PM
Registered User
 
Join Date: Aug 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks I'll give it a try.

and i know it's not good practice but the access frontend is expected to interface with Remedy which forces certain conventions including this one :s


 
Old August 13th, 2005, 02:18 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

TIP: If a field has a space or special character use [ and ] to wrap the field name so that Access knows it is a field.

Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Escape ' lafilip XSLT 3 May 22nd, 2007 03:31 AM
escape character for double quotes Andy dg C# 2005 3 March 15th, 2007 10:51 PM
how can i make my password asterisk (*****) knightneo Beginning PHP 6 December 21st, 2006 05:41 AM
Forgotten escape character chrscote Classic ASP Basics 4 December 4th, 2006 09:37 AM
Need Escape Character? shaileshmark SQL Server 2000 5 July 20th, 2004 12:35 PM





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