Solved

Access Query in VB5

Posted on 1998-06-11
5
201 Views
Last Modified: 2011-09-20
Can someone tell me hoe (If at all) I can create a query in Access 97 and use it as a recordsource for a data control in VB5?
0
Comment
Question by:wclare
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 100 total points
Comment Utility
Create your query in Access as you normally would.

Once in VB, after you drop your data control on a form, set the database property to the correct mdb file, then the recordsource will have the query listed amongst the tables.

It's a good idea to name your queries with the letters qry at the beginning. (ex: qryCostTotals)

Field names will work just as if you had attached to a table.
0
 

Author Comment

by:wclare
Comment Utility
I tried that but didn't get the query listed in the dropdown box for the recordsource.
0
 
LVL 6

Expert Comment

by:clifABB
Comment Utility
Hmmm.  Very odd indeed.  I tried it before I answered just to make sure it worked.

Some silly questions:
Do you get the tables listed?
What is the name of the query?
Is the name of the query the same as the name of a table?
0
 

Expert Comment

by:qizhizhu
Comment Utility
try to set data control on your VB firm first. then get your VB database name match your "mdb" database. then set down other properties. Another way is to use Active X control. If you still confuse, let me know. also you can refer to VB help to work through.
0
 

Author Comment

by:wclare
Comment Utility
It is working now.  I must have been trying to set a control box rather than the data control.  Thanks all
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

728 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

9 Experts available now in Live!

Get 1:1 Help Now