1 Replies - 424 Views - Last Post: 25 September 2012 - 07:19 AM Rate Topic: -----

#1 Shivam20292  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 04-August 12

Trouble creating table in access

Posted 23 September 2012 - 10:15 PM

Dim TabName As String
    
    TabName = txt_invoiceno.Text
    
    db.Execute ("CREATE TABLE  " & TabName & "" _
                & "Invoice_No Text(20)," _
                & " Supplier_Name Text(20)," _
                & " Purchase_Date Date," _
                & " Delivery_Date Date," _
                & " Material_Type Text(20)," _
                & " Material_Name Text(20)," _
                & "Order_Qty Number(DOUBLE)," _
                & "Price_Per_Unit Number(DOUBLE)," _
                & "Total_Amount Number(DOUBLE)," _
                & "Received_Qty Number(DOUBLE)," _
                & "Qty_Instock Number(DOUBLE)")





I want to create table in the existing database at runtime through which is named as the data entered in the text box of my form.

When I run this code, this gives me an error in create table statement.

Please let me know how to come out of this problem and execute the statement successfully.

Is This A Good Question/Topic? 0
  • +

Replies To: Trouble creating table in access

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: Trouble creating table in access

Posted 25 September 2012 - 07:19 AM

The first thing to do is attempt to run the create statement in Access directly, and see if it creates your table. The next thing is that "an error" isn't enough information for anyone to work out what the problem is. It's like calling 911 to say that there's been a car accident without saying where the accident is. :) So, first run this in Access, then if you still have an error, post back telling what the error is and where it comes up.

This post has been edited by BobRodes: 25 September 2012 - 07:28 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1