VB List Box Versus Access List Box 
Author Message
 VB List Box Versus Access List Box

The following question could apply to combo boxes as well:

I don't see any property in a VB 6 list box which dictates the number of
columns a list box contains a la Access.  How do we do this?
--
Tim - http://www.*-*-*.com/ ~tmarshal/
 ^o<  
 /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^  "Want some?" - Ditto



Mon, 14 Mar 2005 05:16:40 GMT  
 VB List Box Versus Access List Box
Unfortunately, the list box in ms-access is real nice, since it can
hide/store the "key" id value, but allow display of additional columns In a
relational database, this is such a common need, that ms-access addressed
from day one (10 years ago!). So, not only does the ms-access listbox allow
more than one column, it can hide the key column for you..and that is what
one wants about 9 out 10 times. It is a very natural way of doing things.

The solution in VB is to use a datagrid. There is the MSFlex grid, and one
other that is included is the dbgrid. These controls will give you more than
one column.

None of them approach the simplicity of the listbox....and that needed
feature of listing one column..but storing the id....

I not greatly familiar with all the VB controls..and I hope some does chime
in here as mention what control does give more than one column..but store a
id. I was under the impression that there is a combo box that does allow two
collums...but I can't find it right now...

--
Albert D. Kallal
Edmonton, Alberta Canada



Mon, 14 Mar 2005 07:36:36 GMT  
 VB List Box Versus Access List Box
As a side note:

You have the standard combo box in VB..and you fill it using additem

You also have the DBCombo box. This one does allow you to display a column
from a table of your choosing...and also allows the storing a different
field.

In ms-access, the above would be a combo with two columns, and the first
field would have a "length" of zero.

Hence, you *can* have a combo box in VB that displays one field (such as
description), but actually stores the id field.

However,...you can't display more than one column with the DBCombo.

--
Albert D. Kallal
Edmonton, Alberta Canada



Mon, 14 Mar 2005 11:01:47 GMT  
 VB List Box Versus Access List Box
You can sometimes append multiple field or variable values
together to serve a similar purpose as the multi-column list
and combo. Then, you'll need to use code to determine which
choice was made (by list item number, or by content), which
if you aren't binding the control to store in a field in a
record (as is more often the case in Access), is no great
burden. It's not as simple and easy, but it at least can
show the user more information.

--
Larry Linson      http://www.ntpcug.org -- N Tex. PC User
Group
  http://members.tripod.com/ntaccess -- Access SIG
  http://members.tripod.com/accdevel -- Access Samples
  http://members.tripod.com/appdevissues -- Presentations



Quote:
> As a side note:

> You have the standard combo box in VB..and you fill it
using additem

> You also have the DBCombo box. This one does allow you to
display a column
> from a table of your choosing...and also allows the
storing a different
> field.

> In ms-access, the above would be a combo with two columns,
and the first
> field would have a "length" of zero.

> Hence, you *can* have a combo box in VB that displays one
field (such as
> description), but actually stores the id field.

> However,...you can't display more than one column with the
DBCombo.

> --
> Albert D. Kallal
> Edmonton, Alberta Canada




Mon, 14 Mar 2005 11:10:37 GMT  
 VB List Box Versus Access List Box
Albert & Larry,

Thanks very much for your comments.

Our computing department at my university had insited a month ago that
an important Oracle Back-end project be developed using VB.  While I am
fairly good with Access and ODBC connections to Oracle, VB is brand new
territory for me.  The computing department representative insited that
since I knew VBA in Access very well, VB would be a snap.

Far from it <imagine an irritated grimace here!>

Thanks again.
--
Tim - http://www.ucs.mun.ca/~tmarshal/
 ^o<  
 /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^  "Want some?" - Ditto



Mon, 14 Mar 2005 21:43:16 GMT  
 VB List Box Versus Access List Box
Well, actually to be fair...VB, and VBA as far as the language goes really
is the same. The tough part in VB is when you make a data centric
application...the binding of data ---> to controls is a real leap. However,
I actually do agree with that guys as{*filter*}t that the jump from VBA to VB is
small.

It really is using all the data control stuff is where the learning curve
lies. The forms and controls in VB are gearned towards general applction
development...and using VB for database stuff means that more work is
required

--
Albert D. Kallal
Edmonton, Alberta Canada



Tue, 15 Mar 2005 00:06:33 GMT  
 VB List Box Versus Access List Box

Quote:
> Albert & Larry,

> Thanks very much for your comments.

> Our computing department at my university had insited a
month ago that
> an important Oracle Back-end project be developed using

VB.

If there aren't some specific reasons, then they increased
your burden immensely (particularly since you already are
comfortable with Access - ODBC - Oracle). But, if they are
the ones who call the shots, then there's little to do but
learn VB -- that's not the worst thing in the world, anyway.
And, hey, if you are being paid by the hour, take heart,
you're going to be paid for at least twice as many hours!

Most seem to find that binding data with data controls
doesn't work nearly as well in VB as binding forms and
controls in Access, so you'll see much more database work in
VB based on unbound forms. But, you have a "leg up" over
many VB folk, in that you already understand database -- for
example, you know to use a query/SQL with a WHERE clause to
just get the exact record you need, instead of opening a
whole table and doing a FindFirst. A lot of VB people
without database experience have _that_ as a steep learning
curve.

--
Larry Linson      http://www.ntpcug.org -- NTPCUG
  http://members.tripod.com/ntaccess -- Access SIG
  http://members.tripod.com/accdevel -- Access Samples
  http://members.tripod.com/appdevissues -- Presentations



Tue, 15 Mar 2005 23:37:25 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Limiting Access to Text Boxes, List Boxes and Combo Boxes

2. How to list macro names in a combo box or a list box

3. Help wanted with file list boxes and list boxes

4. Q: List Box to List Box Code

5. List box within List box

6. List box within List box

7. List box within List box

8. Use list from excel or access to populate combo/list box

9. dialog box with list box or combo box

10. VB combo list box and Access Table

11. VB combo list box and Access table

12. Listing all tables or queries in a list/combo box

 

 
Powered by phpBB® Forum Software