Solved

displaying data on dbgrid...interesting but tough

Posted on 1998-04-01
1
161 Views
Last Modified: 2012-05-04
how do i display data from two tables in my database in a dbgrid?
codes pls
0
Comment
Question by:icesurfer
1 Comment
 
LVL 1

Accepted Solution

by:
VBert earned 50 total points
ID: 1460154
Add a dbgrid and a data control to your form. Set the dbgrid's .DataMode property to BOUND and it's .DataSource property to DATA1 (the name of your data control.)

Set the Data1.Database to the name of your database, and the Data1.Recordsource to an sql statement that does a join of the two tables you want.

For example, if you have a table of book authors and a table of
book titles, the common field between the two table being author, your sql statement would look something like this...

"SELECT * FROM AUTHORS, TITLES WHERE TITLES.AUTHOR_NAME = AUTHOR.NAME"

When you refresh your data control, the results should show up in your grid.
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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

707 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