Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics 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 January 24th, 2007, 03:37 AM
Registered User
 
Join Date: Jan 2007
Location: Muzaffargarh, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lord_jawad@hotmail.com
Default Sub Form Ideas

Hi Friends!
I have an ms Access database as backend in my VB 6 Application. Throughout the application i am using unbound controls and ADO objects to retrieve and manipulate data in the database.
Now i have to build a form to show the master detail relationship. I was using MS Access before for such cases. So could any one help me how can i gain same functionality in VB 6 form using unbound controls. I was to use same form for Entring data as well as Finding the record.
Waiting for any suitable idea. Thankx in Advance

Jawad Hasan
 
Old January 26th, 2007, 03:09 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I typically use the Listview for listing the detail records.

I have seen many projects where 3rd party grid controls or the intrinsic VB grid contorls (like flexgrid) are used - but for most purposes I personally find these a pain to use.



Woody Z
http://www.learntoprogramnow.com
 
Old January 27th, 2007, 05:22 AM
Registered User
 
Join Date: Jan 2007
Location: Muzaffargarh, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lord_jawad@hotmail.com
Default

Thankx Woody Z!
Well i have used list View control in one of my application. But you know sometime there are situations in which grid like sub form is the best choice. For Example in an Inovice & Invoice Detail Form.
Well in beginning i used Built In Grid Control but its not so user friendly also it does not provide the functionality of Combo Boxes (Like we could accomplished in MS Access Sub Forms). For Example in my sub form instead of Entering Item by keyboard i would prefer to find a way in which i could find item from Combo Box and item code could be automatically Entered in the relavant field. I hope you got what i want.
Any Help or suggestion in this regard????

Jawad Hasan
 
Old January 27th, 2007, 12:08 PM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It is unclear to me what you are asking.

What is a "grid like sub form". Are you saying that you want in-grid editing? There are many third part components that provide this sort of functionality.

However - I don't have a good understanding of what you are asking.

Woody Z
http://www.learntoprogramnow.com
 
Old January 28th, 2007, 12:49 AM
Registered User
 
Join Date: Jan 2007
Location: Muzaffargarh, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lord_jawad@hotmail.com
Default

Well you are right. I want child records in Grid with editing capabilities. But also in this grid i want to show some cells as combo boxes so that those combo boxes (cells) could be linked to a database table.
for example

[tblItem] = Item#, ItemPrice
[tblInvoice] Master Table = Inv#, InvDate
[tblInvLines]Child Table = Inv#(PK), Item(PK,FK), ItemPrice(Linked to Item Table-Automatically Display to show the information but not for storage in tblInvLines), Qty

in grid i want to show [Item] field as combo box which will be linked to [tblItem] table in the database, Through combo box i will select an item and its Item code will be inserted in the child record Item field. and Price will be displayed corresponding to that item in the next col of Grid Control.
When i will save the record Inv#,Item# and qty will be stored in tblInvLines. so the master-detail relationship is between [tblInvoice] & [tblInvoiceLines]....And [tblItem] will be used as a lookup table.
Now you can analyze what i want. its a typical example. My major concern is showing combo box in the grid controls and link those to any table in the database.
You told that there are many thrid party tools but i'll be thankful if you suggest the names or vendors for any one.
Thankx in Advance

Jawad Hasan
 
Old January 28th, 2007, 01:42 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I wish I can be of more help. I have always avoided "edit in grid" controls, and databound controls in VB6. This also goes for the .NET environment. I've been attending a programming conference this weekend and some of the speakers are saying this is now working nicely in .NET 2.0 - but I'm going to do a lot of experimenting with it before I recommend it.

So - what can you do? Someone else here will need to recommend something. I am pretty certain that there are api calls that can be made to provide some of these features - but you will be looking at a lot of work if you have to go that way.

My normal approach is to make an edit form - the user selects an item in the list, selects edit with a context menu or button or whatever, and then edits it in a separate dialog. It keeps things very easy to control. Editing in place in a grid can be difficult to control - it is much more likely to cause bugs and odd behaviors.

Good luck to you - hopefully someone else here is ready to help.

Have fun

Woody Z
http://www.learntoprogramnow.com
 
Old January 28th, 2007, 03:39 AM
Registered User
 
Join Date: Jan 2007
Location: Muzaffargarh, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lord_jawad@hotmail.com
Default

Thankx a lot for your replies and suggestions. So in simple words there is no Easy to use way to accomplish all this. Any way i am also searchin at other sources to simplify this task. I like your suggestion for editing records in a separate form. Yeah right now this is the best alternative.
I hope that your saying of such control in .NET 2.0 may be help ful. So now gradually i will move toward .NET Step by step and i hope your advise ans suggestions will be with us during this journey.
Thank you very much sir.


Jawad Hasan
 
Old January 28th, 2007, 11:47 AM
Friend of Wrox
 
Join Date: May 2006
Location: San Diego, CA, USA.
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In a lot of ways .NET is a big step up from VB6. The only disadvantage is the increase in complexity - but Microsoft has been working a great deal on making things simple while still providing the power, and hopefully they've achieved that.

I've been using C# and VB.NET since about 2001 when it was in beta and I wouldn't want to be without it.

Have fun

Woody Z
http://www.learntoprogramnow.com
 
Old January 29th, 2007, 02:10 AM
Registered User
 
Join Date: Jan 2007
Location: Muzaffargarh, Punjab, Pakistan.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to lord_jawad@hotmail.com
Default

Regarding ADO .net, What is the best starting Point for a beginner having some expereince of Database designs in MS Access and ADO. Also if you could recomend some good sites and books then it would be a timely help. While searching on net i have seen a lot of books about This subject. But i dont want to waste time on silly things. In short i want to know a direct path towards real time applications, especially database programming via objects which could be managed easily.



Jawad Hasan




Similar Threads
Thread Thread Starter Forum Replies Last Post
PLEASE HELP - I need ideas brettk_1 ASP.NET 1.0 and 1.1 Professional 1 July 13th, 2005 12:42 PM
PLEASE HELP - I need ideas brettk_1 ASP.NET 1.0 and 1.1 Basics 1 July 13th, 2005 12:42 PM
Any Ideas????? f117b2 Classic ASP XML 0 January 23rd, 2004 04:36 PM





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