Using Access 97, with the runtime parameter.
I have a an application that needs a filter by form replacement, because
that is unimplemented in runtime mode.
I call the filter parameters form from several lookup forms.
I set up the lookup forms to call the openform using me.name as the
openargs.
I can detect the openargs and validate that it is not null, get the
user's input, validate, build the proper where clause, and pass it back
to the correct parent form by using a select case openargs.
However, I have about 10 case statements that each contain very similar
code, wioth the target form name hard-coded.
What I have:
select case openargs
case "Form1"
forms!form1!child1.form.filter = sqlWhereClause
forms!form1!child1.form.filteron = true
case "form2"
forms!form2!child1.form.filter = sqlWhereClause
forms!form2!child1.form.filteron = true
....
end select
What I want is to replace these statements with the following construct
containing a variable for the form name.
forms!(openargs)!child1.form.filter = sqlwhereclause
forms!(openargs)!child1.form.filteron = true
which would remove 30 lines of redundant code from the class module.
I can't find a way to make it work, Tried setting the whole statement
into a variable, and using eval(), different bracketing, ampersands and +
signs to concatenate,
Please, somebody, point me in the right direction.
Bob Q