Results 1 to 11 of 11

Thread: [RESOLVED] Syntax Error in field definition.

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2016
    Posts
    90

    Resolved [RESOLVED] Syntax Error in field definition.

    Hi,

    I am trying to add a column to a table.
    It was working fine and now suddenly i get an error message " Syntax Error in field definition"


    Code:
    Dim Sql As String
    Dim tbl As String
    Dim col As String
    Dim rtl As String
    
    tbl = Me.Combo67
    col = Me.Combo65
    
    Sql = "ALTER TABLE " & [tbl] & " ADD COLUMN " & [col] & " Text(128) "
    rtl = MsgBox("ADD " & col & " TO " & tbl & " ?", vbYesNo + vbExclamation, "PLEASE CONFIRM")
    MsgBox Sql
    Select Case rtl
            Case 6
            DoCmd.RunSQL Sql
            Case 7
            End
            End Select
    
    End Sub
    Im taking the table Name and the column Name from a Combo box.

    how can I rectify this error??

    Thanks!!
    Last edited by saranmc; Feb 18th, 2016 at 03:42 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width