Access List ctrl = Good / VB List ctrl = Crap ??? 
Author Message
 Access List ctrl = Good / VB List ctrl = Crap ???

In Access95 I can easily fill the list  control with rows of data from
a table by setting its row source to an SQL statement like this :

"Select * From Customers Where SSN = tbSSN"

In the string above tbSSN is a textbox that the user types an SSN in.

In VB4.0 I try to set the Data Controls RecordSet property to the same
string and I get errors...

My reference to the list control is based on in Access the list
control has a Rowsource property that accepts an SQL string. For some
reason in VB EVERY thing seems to have to be bound to the Crappy Data
Control!!!

Why can I not just fill a Grid of SOME kind with out using the
DataControl ?????

Am I just stupid here or what ???

Thanks for any comments...



Mon, 19 Oct 1998 03:00:00 GMT  
 Access List ctrl = Good / VB List ctrl = Crap ???


Quote:
>In Access95 I can easily fill the list  control with rows of data from
>a table by setting its row source to an SQL statement like this :

>"Select * From Customers Where SSN = tbSSN"

>In the string above tbSSN is a textbox that the user types an SSN in.

>In VB4.0 I try to set the Data Controls RecordSet property to the same
>string and I get errors...

>My reference to the list control is based on in Access the list
>control has a Rowsource property that accepts an SQL string. For some
>reason in VB EVERY thing seems to have to be bound to the Crappy Data
>Control!!!

>Why can I not just fill a Grid of SOME kind with out using the
>DataControl ?????

>Am I just stupid here or what ???

>Thanks for any comments...

Actually the list box in access is a bound control, it's just bound to
Access.

You can fill any unbound listbox by just reading the vaules from an array
(or recordset) then appending them to the listbox control.

Richard



Tue, 20 Oct 1998 03:00:00 GMT  
 Access List ctrl = Good / VB List ctrl = Crap ???


Quote:
>In Access95 I can easily fill the list  control with rows of data from
>a table by setting its row source to an SQL statement like this :
>"Select * From Customers Where SSN = tbSSN"

Take a look at the on-line help for WHERE.
Quote:
>In the string above tbSSN is a textbox that the user types an SSN in.
>In VB4.0 I try to set the Data Controls RecordSet property to the same
>string and I get errors...
>My reference to the list control is based on in Access the list

As you found out, VB is not Access.

Quote:
>control has a Rowsource property that accepts an SQL string. For some
>reason in VB EVERY thing seems to have to be bound to the Crappy Data
>Control!!!
>Why can I not just fill a Grid of SOME kind with out using the
>DataControl ?????
>Am I just stupid here or what ???
>Thanks for any comments...

This requires no data control or bound control of any type.
It nicely fills a list box in short order.

Dim ListSet As Snapshot
Dim MyDB As Database
Dim MyTable As Table

Set MyDB = OpenDatabase("C:\tables\mydata.mdb")
Set MyTable = MyDB.OpenTable("People")
Set ListSet = MyTable.ListFields()
MyTable.Close

Do While Not ListSet.EOF
    lstNames.AddItem ListSet("First_Name")
    ListSet.MoveNext
Loop


http://www.xnet.com/~kd9fb



Thu, 22 Oct 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Must Restrict access to NT Task List (CTRL+ALT+DEL)

2. HOW CAN I DISABLE CTRL+X, CTRL+V,CTRL+C

3. HOW CAN I DISABLE Ctrl+C,Ctrl+V,Ctrl+X

4. VB List ctrl

5. CTRL-ALT-DEL and the tasks running that are listed there

6. Hide an app from ctrl+alt+del list?

7. CTRL+ESC Task List

8. Task List (CTRL+ESC) intercept??

9. Adding icons or bmps to the cells of a list ctrl or Flexgrid

10. Adding icons or bmps to the cells of a list ctrl or Flexgrid

11. Ctrl+Alt+Del list of programs...(task manager)

12. ctrl alt del - task list

 

 
Powered by phpBB® Forum Software