Pass value from FORM into parameter query
Posted on 2004-11-05
I have a parameter query that prompts me to enter a billet code (a "billet code" is the equivalent to a customer id).
I the the billet code exists, the correct record is brought up. So far so good...
Below is the SQL code for parameter query:
SELECT tbl_BilletCodes.BilletCode, tbl_BilletCodes.Division, tbl_BilletCodes.Prefix, tbl_BilletCodes.Extension FROM tbl_BilletCodes WHERE (((tbl_BilletCodes.BilletCode)=[Me].[BilletCode]));
In a form, I have the four fields (BilletCode, Division, Prefix, and Division). In this form I don't allow any changes to the fields (unless I "double-click" BilletCode). However, a double-click event brings up another form (data source of this subform is the SQL code of the parameter query) where I then can update the record. So far so good...
Here's the problem now ... when I double-click on BilletCode, I get the parameter dialog box into which I must enter the billet code. Instead, I just want to automatically pass the value of the double-clicked BilletCode and bring up the record w/o any additional input. That's not happening though....
Does anyone know how I can pass the value of the currently selected (double-clicked) billet code into the parameter query so that I get the proper single record in the form (I don't want to see all other records).