Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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
  #1 (permalink)  
Old January 3rd, 2007, 10:47 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default show results of SQL in txtbox

I'm trying to find a way to show the results of several queries in a form and then a report. (I have a "laundry list" of "results" that I need to produce and want to put as many together as possible.

I tried txtTxtbox.text = docmd.runSQL " SELECT count[rest of statement goes here]"
and that did not work. Could someone point me in the right direction. The books I have here are on no help in the matter....

Thank,

Lroalee

  #2 (permalink)  
Old January 4th, 2007, 08:25 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You can do this. It depends on what the recordset looks like.

If you expect a single value, then you should open the recordset and take the field value you want as a string variable, and then post the string variable to the text box.



mmcdonal
  #3 (permalink)  
Old January 4th, 2007, 10:35 AM
Friend of Wrox
 
Join Date: Mar 2004
Location: Yorba Linda, California, USA.
Posts: 217
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks. These are all single values, and I want something faster than a series of DCounts/DSums.

The final report is supposed to "look just like the paper version".

  #4 (permalink)  
Old January 4th, 2007, 11:40 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

You could put a function in a module and then call the module. You might pass the PK from the detail section, and have the string returned by the function. So your On Format event for the detail section of the report would have:


txtTxtbox.text = MyFunction()


mmcdonal


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL query for frequency-related results ire MySQL 4 December 25th, 2008 04:51 PM
SQL returning odd results jakeone SQL Language 1 November 13th, 2006 05:07 AM
Gridview/SqlDataSource won't show results fizzerchris ASP.NET 2.0 Professional 4 September 27th, 2006 02:35 PM
Gridview won't show results fizzerchris ASP.NET 2.0 Basics 0 September 22nd, 2006 06:20 PM
$sql not returning results, this cant be this hard cspgsl Beginning PHP 0 May 5th, 2006 11:50 AM





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