Solved

Access Query in VB5

Posted on 1998-06-11
5
210 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
clifABB earned 100 total points
ID: 1463135
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
ID: 1463136
I tried that but didn't get the query listed in the dropdown box for the recordsource.
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1463137
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
ID: 1463138
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
ID: 1463140
It is working now.  I must have been trying to set a control box rather than the data control.  Thanks all
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
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…

733 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