sub5
Programmer
- Oct 12, 2005
- 104
Hi all,
I have form1 which opens form2. On form2 are two subforms.
subform1 has an on current event:
dim strCond as string
strCond = "ID = forms!form2!sub1.form!ID"
forms!form2!sub2.form.filteron = true
forms!form2!sub2.form.filter = strCond
When I have the recordsource of sub1 including a criteria reference to a field ie forms!form2!ID, then everything works OK. But if I change the critera to a number say 257, which is an ID that exists, I get the following error when I try to open form2:
2455 you entered an expression that has an invalid reference to the property form/report
debug takes me to the ....filteron = true line of code
Any ideas?
I have form1 which opens form2. On form2 are two subforms.
subform1 has an on current event:
dim strCond as string
strCond = "ID = forms!form2!sub1.form!ID"
forms!form2!sub2.form.filteron = true
forms!form2!sub2.form.filter = strCond
When I have the recordsource of sub1 including a criteria reference to a field ie forms!form2!ID, then everything works OK. But if I change the critera to a number say 257, which is an ID that exists, I get the following error when I try to open form2:
2455 you entered an expression that has an invalid reference to the property form/report
debug takes me to the ....filteron = true line of code
Any ideas?