Passing multiple parameters to a form
Thank you for taking the time to report an issue.
What's wrong... Please write below.
Ive seen a few articles on how to pass parameters from a form to a report which has one record source but cant seem to find any demonstrating how to pass parameters from the form to multiple sub reports contained within the same main report.
The main problem is, I do not know the number of parameters I will need to pass into to the query before I run the file (but I could potentially know this number before I run the query). Because of this, I cannot hardcode ?'s into my query and pass the corresponding number of parameters.
The number of parameters I am passing depends on a file searched earlier in my code. So, I could have anywhere from one to hundreds of parameters.
One away around this problem is to call individual queries for each parameter, and compile a table based on each item returned. I would rather not do this because I want to make use of SQL’s ORDER BY function, which I know is more efficient than sorting a table using C# code after I have called the queries.
I got a problem with passing parameters to forms.
The situation is:I have 9 or ten forms with two data fields changing all the time.
The forms are named: answer_form1.ans_form10
the the data table doesn't change.
the columns changing: in answer_form1 = quest2res1
in answer_form2= quest2res2 and so forth.
I want to create a main form and pass the form name and the columns in parameters so that the form will open in the right mode by the user's selection
Can someone help in that or is there an example that I can study that?
For example, the form would have something like
FieldName1: Please select one or more of the following.
[this next part would be a selection of some sort, check boxes?, combo box?]
The user would then select which of the 4 items above they want to see in the query (note again that the above parameters are all contained in the same field).
I am using Access 2003
When the user enters in parameters and hits Ok, the intended form pulls up, but only the tab of the form. but with blank fields which would tell the user that the parameters were wrong.
If there a way the parameter form show a error message or something if the parameters entered by the user are not found? Probably in VBA I am assuming.
Or it would even be helpful to get the form to at least open, but as of right now the form leaves the user stuck.
How do I create a sort of "dialog" box that allows the user to enter multiple parameters all at once.