Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
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 January 15th, 2004, 10:37 AM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Open a parameter query programmatically

I have created some parameter queries (they ask for user input).
I want the user to input the required parameters not from the input box of the query but from a textbox located in a form.
i.e. The user enters a value in a textbox of a form. I want this value to be used as a parameter to open the query.
How can I do that?

 
Old January 15th, 2004, 11:42 AM
Authorized User
 
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can write a dLookup function in VB as an event on the form. Pass the value of the drop down box to the VB event and have it return the value(s) that you are looking for.

If you can, give me an example of the type of recordset to be returned by the query and I'll send you some sample code that might work. Also, indicate what you will be doing with the returned info

John

 
Old January 15th, 2004, 11:48 AM
Authorized User
 
Join Date: Dec 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

PS

You can also use a button on the form that the user would press to run the query.

Simply use the syntax forms!'formname'!'fieldname' as the criteria in the query design. Again, if you send me youor end goal I'll give you some coding hints

John

 
Old January 16th, 2004, 08:16 AM
Registered User
 
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jrwlkn
 PS

You can also use a button on the form that the user would press to run the query.

Simply use the syntax forms!'formname'!'fieldname' as the criteria in the query design. Again, if you send me youor end goal I'll give you some coding hints

John

This second suggestion is exactly what I was looking for.
Thanks a lot, John.
You have been very helpful.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Query Help Normie Access 5 February 19th, 2008 01:50 PM
Parameter Query Teqlump Access 4 November 11th, 2004 07:21 PM
Non query Report Parameter qa BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 2nd, 2004 02:49 PM
Adding second parameter to open page nbryson ADO.NET 0 September 18th, 2003 06:59 AM
Parameter Query Ben Access VBA 1 June 27th, 2003 12:13 PM





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