Solved

master/detail dbgrid manipulation in VB6

Posted on 1998-10-14
3
267 Views
Last Modified: 2013-12-25
HI,
I Would like to know if it is possible to make a master/detail dbgrid.for ex by entering the client code in one col, the corresponding name from the master file is shown on the same row. I am using VB6.
0
Comment
Question by:jadidbin
  • 2
3 Comments
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1487647
You mean showing a field from a relative table?
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1487648
I assume you do want to show a relative field.

The flexgrid sample in the vb samples. (samples\pguide\msflexgd)

The can make a snapshot and assign it to the recordsource property of the datacontrol like this.

    mysql$ = "SELECT "
    mysql = mysql & "Publishers.[Company Name], "
    mysql = mysql & "Authors.Author, "
    mysql = mysql & "Titles.Title "
    mysql = mysql & "FROM Authors INNER JOIN "
    mysql = mysql & "(Publishers INNER JOIN ([title author] INNER JOIN Titles ON [title author].ISBN = Titles.ISBN) ON Publishers.PubID = Titles.PubID) "
    mysql = mysql & "ON Authors.Au_ID = [title author].Au_ID "
   
    Data1.RecordSource = mysql

0
 

Author Comment

by:jadidbin
ID: 1487649
Thanks Mirkwood ,however i am using ado and and dbgrid and i am opening my recordsets in batch mode. the solution by Mirkwood works if i am working in immediate mode and i refresh manually. I would like it to happen in batch mode the same as in immediate mode
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now