Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


VB & Access

Posted on 2005-03-10
Medium Priority
Last Modified: 2010-05-02
i am trying to create a table in access through vb... i have the following and i get a runtime error stating that my syntax is incorrect.  Anyone know what wrong?

strTableName = "VDealerH-" & Format(Now, "yyyymmdd")
strSql = "Create Table " & "" & strTableName & " " & "(DLR_NUM int, DLR_NAME Text, DLR_ADDR int)"

conn.Execute (strSql)

code looks like this :
Create Table VDealerH-20050310 (DLR_NUM int, DLR_NAME Text, DLR_ADDR int)
Question by:JoannieJefferson
LVL 55

Accepted Solution

Ryan Chong earned 1000 total points
ID: 13507653
try use branket instead, like:

strTableName = " [VDealerH-" & Format(Now, "yyyymmdd") & "] "
strSql = "Create Table " & strTableName & " " & "(DLR_NUM int, DLR_NAME Text, DLR_ADDR int)"

conn.Execute (strSql)

see if this works?

Author Comment

ID: 13507750
You are wonderful. Thanks!

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 6 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question