combo


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: combo

  1. #1
    poch Guest

    combo


    hi Victoria,

    one way to do this is to query the sysobjects system table or query the
    information_schema.tables.

    hope this helps.

    regards,
    poch
    "Victoria" <miwok74@hotmail.com> wrote:
    >
    >Hi,
    >
    >My question is....
    >
    >Say I have 3 tables (tblOne, tblTwo, tblThree) in a SQL DB named TABLES.
    >When the form loads I want my combo box (combo1) to fill up with the tables
    >(tblOne, tblTwo, tblThree).
    >
    >
    >Thanks,
    > Vic



  2. #2
    Victoria Guest

    Re: combo


    Hi,

    I just want the table names (tblOne, tblTwo....) to show up in the combo
    box when the form loads. I'm really not sure if thats what your response
    would help with but can you please explain somemore what you mean.

    thanks,
    Vic

    "poch" <pochreyes@yahoo.com> wrote:
    >
    >hi Victoria,
    >
    > one way to do this is to query the sysobjects system table or query the
    >information_schema.tables.
    >
    >hope this helps.
    >
    >regards,
    >poch
    >"Victoria" <miwok74@hotmail.com> wrote:
    >>
    >>Hi,
    >>
    >>My question is....
    >>
    >>Say I have 3 tables (tblOne, tblTwo, tblThree) in a SQL DB named TABLES.
    >>When the form loads I want my combo box (combo1) to fill up with the tables
    >>(tblOne, tblTwo, tblThree).
    >>
    >>
    >>Thanks,
    >> Vic

    >



  3. #3
    Alex Guest

    Re: combo


    Victoria,

    There is a lot of ways to fill combobox but each of them involves AddItem
    method (see VB help for details)

    Here are few examples

    Example 1

    Private Sub Form_Load()
    With Combo1
    .AddItem "tblOne"
    .AddItem "tblTwo"

    .AddItem "tblLast"

    .ListIndex = 0 'selects first item in the combobox
    End With
    End Sub


    Example 2

    Private Sub Form_Load()

    'some code to get table names in array arrTables
    '
    ' ...
    '

    For n = LBound(arrTables) To UBound(arrTables)
    Combo1.AddItem arrTables(n)
    Next
    End Sub


    Example 3

    Private Sub Form_Load()
    Dim RS As Recordset
    '
    ' ...
    '
    'assume you have opened recordset RS with field "TableName"
    'containing information for your combobox

    With RS
    If Not (.BOF And .EOF) Then
    .MoveFirst
    Do While Not .EOF
    Combo1.AddItem .Fields("TableName").Value
    'do other stuff
    Loop
    End If
    .Close
    End With
    End Sub



    Alex


    "Victoria" <miwok74@hotmail.com> wrote:
    >
    >Hi,
    >
    >I just want the table names (tblOne, tblTwo....) to show up in the combo
    >box when the form loads. I'm really not sure if thats what your response
    >would help with but can you please explain somemore what you mean.
    >
    >thanks,
    > Vic
    >
    >"poch" <pochreyes@yahoo.com> wrote:
    >>
    >>hi Victoria,
    >>
    >> one way to do this is to query the sysobjects system table or query the
    >>information_schema.tables.
    >>
    >>hope this helps.
    >>
    >>regards,
    >>poch
    >>"Victoria" <miwok74@hotmail.com> wrote:
    >>>
    >>>Hi,
    >>>
    >>>My question is....
    >>>
    >>>Say I have 3 tables (tblOne, tblTwo, tblThree) in a SQL DB named TABLES.
    >>>When the form loads I want my combo box (combo1) to fill up with the tables
    >>>(tblOne, tblTwo, tblThree).
    >>>
    >>>
    >>>Thanks,
    >>> Vic

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center