Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Access Query in VB5

Posted on 1998-06-11
5
Medium Priority
?
214 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

660 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