Pass Parameters to Queries in Access

Atmosphere
04-20-2004, 11:38 AM
1) Is it possible to pass parameters to queries in access?

2) [Simplified] I have two text boxes in a report. I want each text box to pass a predefined parameter to a query, and extract a result from the resulting query. Is this possible?

xxdcmast
04-20-2004, 11:40 AM
1) Is it possible to pass parameters to queries in access?

2) [Simplified] I have two text boxes in a report. I want each text box to pass a predefined parameter to a query, and extract a result from the resulting query. Is this possible?

You mean like select * from DATABASE where NAME1 = "textbox1" and NAME2 = "textbox2"

if thats the case then yes it is possible you just need to dimension some variables and store the values of the textboxes as strings into those variables

Atmosphere
04-20-2004, 06:00 PM
Actually, i probably wasnt that clear

say i have a chart


...........Col1.......Col2........Col3
Row1....(1,1)......(1,2).......(1,3)

where (x,y) is an entry in the table in the xth row and yth column

The actual table is about 5x5. for any (x,y), i want it to return a result from a query where x and y are the parameters

Is this possible

MKoslof
04-20-2004, 07:29 PM
So you want to pass a field from your recordset as a parameter? If so, what determines what fields are passed (if there are five fields, what will determine which one to pass)? Are you trying to update another recordset, populate a report, etc.

Atmosphere
04-21-2004, 06:25 AM
I am trying to populate a report.

I would probably run some code that goes through each combination of parameters and assigns the outcome of each pair to a text box. In that case i think I answered my own question.

Maybe if I had two invisible labels, and for each combination of row and column (looped through in the code), set the labels to the row and column name, and then have the query extract the data from the labels. I think thats what i will try, if there is a better way feel free to make suggestions.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum