Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2005, 12:54 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Kevin and Penta,

Just to avoid any confusion, Penta is working with the DataCombo ocx control in the Microsoft DataList Controls dll and the ADO Data Control in the Microsoft ADO Data Control dll. I’m just working with the plain old, vanilla, intrinsic combo box control (no data-binding included).

Also, there is no way to increase the default 8 item drop-down display, and VB6 has no concept of a “continuous form”. Standard alternative is a list box control (which I prefer even in Access anyway).

HTH,

Bob


 
Old December 16th, 2005, 01:08 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bob,
I think I see what you're saying. Instead of having a continuous form, set up a listbox that is preloaded with possible selections, and making it a multi-select list, so after they choose their entries, you programatically go through the selected items.

Am I on the right track?

Thanks again,

Kevin

dartcoach
 
Old December 16th, 2005, 01:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Kevin,

That's the idea, though the Multi-Select functionality is optional.

I generally display lists of data (search results, etc.) in read-only list boxes (ListViews and ArrayLists in .NET). Don't like the idea of displaying multiple, editable records. Double-clicking a record in the list box opens a second form with the records data displayed in editable controls. This is one spot where object-oriented programming is really handy. Double-clicking a record in the list control instantiates, say, a Cutomer object from a Customer class, and the record's field values are stored in the Customer objects "fields" (i.e., property variables). Then just pass the Customer object to the data editing form, and read the object's property values back into the form's editable controls. When your done editing the record, pass the updated object to a data access routine, assign the object property values to an ADO Command objects parameters collection, and update your database. The tried and true 3-tier app. Only way to go.

You can do the exact same thing with Access and VBA.

HTH,

Bob

 
Old December 16th, 2005, 02:02 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 159
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi all,
John Connell, "Beginning Visual Basic 6 Database Programming", wrox, is the book
that will learn u to work with VB6.
My combobox is not limited to 8 item drop down list.
Rgds
P

 
Old December 18th, 2005, 08:38 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bob & Penta,

Thanks for your help. I've got the listbox working for multi-select. I've also got the buttons working to open a new form.

One more question though - once the user has selected 1 or more from the listbox, how do I identify, programmatically, which ones were selected? I'm trying to use a loop through the list, that works fine, but I can't find the identifier that says that particular item was selected.

All your help is appreciated. (I will be buying the book, next payday)

Thanks again,

Kevin

dartcoach
 
Old December 18th, 2005, 10:17 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bob & Penta,

Figured it out. I was having problems with the syntax.

Just to let you know what I'm trying to do:

I've got an application that I wrote completely in Access and VBA. I'm trying to convert it to VB6 with Access as the backend.

Problem:
One of the things I do in the Access app is to dynamically create a form based on user input, then open it for more user input. Since VB is compiled, is there a way to do this? The reason is that Access limits the form size to 22", and I need more space.

Why, you ask? I run a dart tournament every week. The form I'm creating is the tournament bracket. Since each week I might have anywhere from 16 players to 50 players (maybe even more), I need the bracket to be dynamic, and if there are a lot of players, 22" isn't big enough.

Does this all make sense to you?

Thanks again for all your help.

Kevin

dartcoach
 
Old December 18th, 2005, 02:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Hi Kevin,

The height and width properties of VB6 forms are system dependent. I'm not positive about this, but I've never seen a VB6 form that you can scroll beyond the bounds of its parent container, like you can in Access applications. Access is an MDI (multi-document interface) app that allows you to create child MDI forms that are slightly larger than the parent MDI container. So the child form can "scroll off the screen" a bit. I created a simple VB6 MDI parent form and opened a child form in it, but the child form’s max width seems constrained to the max width of the parent container form, which in turn is system dependent.

VB6 form width and height properties are given in twips, and the widest form I can generate on my system is 14.5” (21000 twips/1440 twips).

‘Bout the best I have to offer,

Bob


 
Old December 18th, 2005, 03:05 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Bob,
Thanks for the response (on Sunday, no less!).

Can I create a form that has vertical scroll bars? I've added a scroll bar, but don't know how to make it work.

Thanks again,

Kevin

dartcoach
 
Old December 18th, 2005, 03:14 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Kevin,

This looks like some really promising unexplored territory for me. I'm going to throw the project together just for sport, and we can compare notes:

http://www.vbexplorer.com/VBExplorer/tips/src26.asp

Bob

 
Old December 18th, 2005, 03:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Cool...no need to throw it together. There is a VB6 download at the bottom of the link. Works perfectly and looks like its exactly what you need.

Bob






Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening ,dbf file through ADO in VB6? vchell VB Databases Basics 2 September 11th, 2007 03:43 AM
opening VBA project in VB6 joseph1 VB How-To 0 July 8th, 2006 08:25 AM
Run ACCESS Aplication Without Opening ACCESS kamal1667 Access 3 January 2nd, 2006 12:13 PM
Opening unknown table names NiMot VB Databases Basics 2 July 17th, 2003 02:37 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.