Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 12th, 2007, 06:24 PM
Registered User
 
Join Date: Sep 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Another basic access query

Hi All,

Thanks again for your help with my previous query.

I've run into another problem. I'm trying to create a query to list a table based on data selected from another table in a list box on a form.

How do i integrate my query with the data in the list box.

eg List box lists table called Environment containing (ID and Environment). Querying CI table containing (ID, EnvironmentID, Name).

Writing the SQL is cake, how i get the data to display is beyond me.

Chris

 
Old September 13th, 2007, 06:38 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

How do you want to display the data? Do you want it to appear in a report, form or subform?

For a report, for example, base the report on a stored query. Then in the criteria line for EnvironmentID add something like:

[Forms]![frmMyFormName].[cboMyEnvironmentCombo]

You can check that a value has been submitted on the On Click event of the button that launches the report or form, and on a report, you can add a On No Data event, and check for data on the On Load event of the form etc.

At least that is how most top Access developers do it. =
Did that help?


mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic SQL query john2007 Beginning VB 6 2 January 18th, 2007 04:39 PM
Visual basic update query barteksollie Access 1 August 7th, 2006 01:55 AM
Basic char array and cin query. gillianbc C++ Programming 4 November 4th, 2004 07:44 PM
How to access foxpro Database using Visual Basic Ling Fong Access 1 August 23rd, 2004 07:42 AM
Programmatic access to Visual Basic Project is not aspadda Excel VBA 2 March 19th, 2004 04:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.