473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parameter query - capture value and populate a form

Greetings,
I have a form (Form1) based on a parameter query (Query1). I want the
value that the user enters in the parameter window to populate a field
in the form. I've been able to use the following to capture the value
if the qry is satisfied, and put it in a column in the qry.

PARAMETERS value Text (255);
SELECT DISTINCTROW [Table1].[lastname], [value] AS Expr1
FROM Table1
WHERE (((Table1.lastn ame)=[value]));

Two issues - how do I reference Expr1 in the form, and how to I still
capture the value if the qry is not satisfied.

Thanks in advance,
Yodel99

Nov 13 '05 #1
1 2436
Don't make your form try to reference the query. Make your query reference the form value.

Put a condition on your query like
forms!form1.[fieldname]
Yodel99<ja***** @ieee.org> May 12, 2005 4:11:07 pm >>>

Greetings,
I have a form (Form1) based on a parameter query (Query1). I want the
value that the user enters in the parameter window to populate a field
in the form. I've been able to use the following to capture the value
if the qry is satisfied, and put it in a column in the qry.

PARAMETERS value Text (255);
SELECT DISTINCTROW [Table1].[lastname], [value] AS Expr1
FROM Table1
WHERE (((Table1.lastn ame)=[value]));

Two issues - how do I reference Expr1 in the form, and how to I still
capture the value if the qry is not satisfied.

Thanks in advance,
Yodel99

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3118
by: thomas goodwin | last post by:
I have a query which asks for a parameter value to execute it. To see the results I have to: a) click on the query -- the "Enter Parameter Value" window pops up. b) enter the parameter value c) look at results in datasheet view If I want to run the query again, I must d) click to close the datasheet view e) click on the query f) enter the parameter value
9
6996
by: Megan | last post by:
Hi- I'm creating a database of music bands with their cds and songs. I'm trying to program an SQL statement so that I can enter a string of text in a textbox, press the 'Enter' key, and have it return the associated records to a listbox. Once the listbox has the records, I want to select a record, which will open a form associated with the selected record in the listbox.
6
7114
by: Andy | last post by:
Hello, I am having many problems with setting up a parameter query that searches by the criteria entered or returns all records if nothing is entered. I have designed an unbound form with 3 fields on it: Date (DateSpan1 and DateSpan2), Originator, and GroupName. I have added a button that triggers a query and uses those fields as its parameter criteria to populate a form. The user must be allowed to either enter all of the
2
30312
by: rg | last post by:
Hi all, I have query about passing a parameter from form to a query. My situation is as follows: I have a query that pulls up some data from a table, however there is a condition that must be filled in by the user. Hence when you run the query there is a "Enter Parameter Value" prompt that must be completed. A further complication is that the parameter is actually within the WHERE statement, i.e.:
2
1720
by: daralick | last post by:
I have a form with two subforms. The main form holds the Order Number and basic information. The 1st subform holds an abbreviated list of products in the order and the data source is a table that uses master and child fields to populate. The 2nd subform holds product details and I am attempting to use a query with one parameter to populate details. On the form load the product detail should be the first product in the 1st subform. ...
1
6057
by: cdun2 | last post by:
Hello, I have a parameter query called 'Rev by AcctCode' that takes it's value from a form field; Forms!!. I am trying to find a way to run this query, get the parameter value to it, and populate an Excel spreadsheet with the results. Apparently, there is no direct way to use TransferSpreadsheet with a parameter query. Instead, could I somehow get the results into a QueryDef, then use the named QueryDef with TransferSpreadsheet? ...
3
2508
by: Tim Olson | last post by:
I'm using a form to pass parameters to a query, with results displayed in a report. Currently, I'm using parameters as filter criteria in the query, and everything is running smoothly (or so it appears). However, I'd like to pass sorting parameters (i.e., field names from one of the tables being queried) via the form, allowing the user to populate the ORDER BY command. Is it possible to pass sorting parameters in Access 2000? I can't...
20
5217
by: exipnakias | last post by:
Hello Guys. In a form I created a listbox which looks up the values of a table. I want: 1) ..to create a query where a parameter will be needed in order to be loaded. But I do not want to write the parameter, I want to select a row from the listbox and after clicking in a button, the query to automatically take the current value of listbox as the needed parameter and then to load the query. (The Inputbox for "Enter Parameter" will...
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8730
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1607
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.