-
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
-
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
>
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks