Results 1 to 2 of 2

Thread: code help

  1. #1
    Join Date
    Jun 2012

    Unanswered: code help

    I have created a form to create new tables in access and in excel, I have a module referencing Excel. Now the issues is somewhere in this list of code. If someone can look it over and let me know it would be appreciated, thanks!

    Private Function GetTables()

    Dim Myarray As Variant
    Dim TablesSchema As adodb.Recordset
    Dim conn As adodb.Connection

    'reset cursorlocation to allow sorting in ordinal_position
    Set conn = CurrentProject.Connection
    With conn
    .CursorLocation = adUseClient
    End With

    'Get all database tables.
    Set TablesSchema = conn.OpenSchema(adSchemaTables)
    TablesSchema.Sort = ("TABLE_NAME")

    Me.cboTablesList.RowSource() = ""
    Do While Not TablesSchema.EOF

    'Exclude System Tables and Default Treeview Table
    If Left(TablesSchema("TABLE_NAME"), 4) = "MSYS" Or TablesSchema("TABLE_NAME") = "TREEVIEWFEED" Or Left(TablesSchema("TABLE_NAME"), 1) = "~" Then
    GoTo SKIP
    End If

    'Add Tables to the Combobox
    Myarray = Me.cboTablesList.RowSource()
    If Me.cboTablesList.ListCount < 1 Then
    Me.cboTablesList.RowSource = TablesSchema("TABLE_NAME")
    Me.cboTablesList.RowSource = Myarray & ";" & TablesSchema("TABLE_NAME")
    End If

    Set TablesSchema = Nothing
    End Function

  2. #2
    Join Date
    Mar 2009
    Provided Answers: 14
    Without explaining what you're looking for and/or what the problem (if any) might be, I seriously doubt that anyone will be able to help you.
    Have a nice day!

Posting Permissions

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