G
Guest
I have an unbound subform that I am binding at runtime in VBA. I want to change the recordsource of the subform based on criteria selected by the user. Two options are: date range or a number. The user needs to be able to select the last X work orders where X is an integer. I am creating a SQL statement for the second option and want to do one of two things: set the recordsource of the subform to the SQL statement OR create a recordset from this SQL statement and bind the subform to the recordset
I have tried both and get error msgs -- either 2455 (I've made an invalid reference to the form) or the property is not supported. I read Allen Browne's faq re: the name autocorrect problems and have imported all of my objects into a new db but still got the errors
I have tried referencing the subform as follows
me.subform.form.recordsource = strsq
me.subform.form.recordset = r
forms!mainform.subform.form.recordsource = strsq
me.form(subform).recordset = r
None of the above worked
Thanks for any help
Diana
I have tried both and get error msgs -- either 2455 (I've made an invalid reference to the form) or the property is not supported. I read Allen Browne's faq re: the name autocorrect problems and have imported all of my objects into a new db but still got the errors
I have tried referencing the subform as follows
me.subform.form.recordsource = strsq
me.subform.form.recordset = r
forms!mainform.subform.form.recordsource = strsq
me.form(subform).recordset = r
None of the above worked
Thanks for any help
Diana