just want to know the correct synthax for creating a table in access database using vb

  myqry = "CREATE TABLE HoldInvoide'" & k & "'(Barcode varchar(20) not null Primary Key, ItemName varchar(40) not null, Quantity int , Price double, Total double)"

k is a variable
i want to create a table called HoldInvoice1 then HoldInvoice2 ....

I don't have Access installed (I use MS SQL) so I created the table in MS SQL then scripted the table. The portion that might be of use to you is

CREATE TABLE   [dbo].[HoldInvoice](
    [Barcode]  [varchar](20) NOT NULL,
    [ItemName] [varchar](40) NOT NULL,
    [Quantity] [int]             NULL,
    [Price]    [money]           NULL,
    [Total]    [money]           NULL,
CONSTRAINT     [PK_HoldInvoice] PRIMARY KEY CLUSTERED 

I don't knkow if Access supports fields of type money. Change to a more appropriate type if not. I hope this helps.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.