Solved

displaying data on dbgrid...interesting but tough

Posted on 1998-04-01
1
165 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 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