OpenArgs and unwanted Parameter Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building a project using Access 2003 sp2 linked to a SQL 2000 Database.
All tables and queries are SQL based.
I have a search form that supplies between one and three parameters to a
searchresults subform. The subform displays employee wage information, and
the parameters supplied can be any combination of Insurance No, Date of Birth
and Surname. The parameters are passed to the subform as a pipe delimited
string via the OpenArgs property of the Openform method.
Code in the subform disassembles the Openargs string using the Split
function and generates up to 3 arguments. These arguments are used to pass
the parameters to the SQL stored procedure that populates the subform.
Using Messagebox, I can see that the string is correctly structured
immediately prior to the Openform command, and debugging also confirms that
the arguments are being correctly disassembled. The stored procedure also
runs perfectly using any combination of the supplied parameters and populates
the subform exactly as intended.
The stored procedure uses the COALESCE function to operate with any
combination of the three supplied parameters. The procedure is coded in a
similar way to the example shown here:

http://www.sqlteam.com/article/implementing-a-dynamic-where-clause

So, everything works as expected, with one exception. At the point in the
code where the Openform method is called, a parameter box pops up requesting
the DateOFBirth parameter. If I just 'OK' this box, the code continues as
expected and the subform populates correctly.
How can I prevent this parameter box appearing please?

Any help would be greatly appreciated!

cheers

colin
 
Hi

Just working through the usual possibilities, my first guess would be that
the form's source query is asking for this parameter.

It's also possible before the form is opened the code explicitly asks for
user input.

Can you post the query SQL and the calling code?

Andy Hull
 
Hi Andy,

thanks very much for your reply. Since my original post, I think I've solved
the mystery of the unwanted pop up parameter boxes. At some point in the form
development, the InputParameters property of the results subform got
unknowingly populated. After resetting the property box, everything behaves
exactly as anticipated.
I am tempted to include code that runs every time the search form is opened
to ensure that this property is not being re-populated,

thanks again,

colin
 
Back
Top