Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Parameter Values

Status
Not open for further replies.

rexie

IS-IT--Management
Jan 31, 2002
32
US
Hi,

I Have a form and would like to pass a value from one form to the Query. Eg below.

Employee Master
===============
Emp No : 1

When on a Button click on form FRM1, I want to select more fields from table 2(same (EMP NO)PKEY) and compute and return back to form1 .

How do I do this. Please help.

Thanks a lot
 
In a query, you can reference controls on an open form via this syntax in a CRITERIA cell:

=Forms!FormName!ControlName

and when you say more fields, do you mean more records? You kind of lost me on that second paragraph of yours...

Jim There are two ways to argue with a woman - neither one works.
Another free Access forum:
More Access stuff at
 
Hi,

Thanks a Lot for that peice of Info. When I write in the criteria in the query, and try to run from the forms, as soon as the control is clicked an input box is popped out to enter values.

But what I need is the value is already enetered in the form and it has to take the forma value and pass to the query.

thanks and please revert back in case of any clarification

 
The input box is popped out because the query thinks you're trying to pass a parameter value instead of referencing the one on the form.

For example - form name Form1, text box name Text1.

The query criteria should be :

=Forms!form1!text1

It might be that you have a spelling discrepancy. For example, if your form field is called "Start Date" (note the space), but your query criteria is

=Forms!form1![startdate]

Note the NO SPACE, then the query/form will prompt you with

STARTDATE:

in an input box. See the problem?

I think if you check your spellings, it should work just fine.

Jim

There are two ways to argue with a woman - neither one works.
Another free Access forum:
More Access stuff at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top