Subform filtering problem

A

Atlas

Access 2003 + ms sql server 2000 (adp)

I have a continuos form whose contents are populated dinamically at runtime
(whenever two comboxes on the form change values) with a "select " statement
assigned to the form's recordsource property.

The form also has a subform (datasheet view) linked by child/master fileds
properties.

It all works perefectly.


Now wishing to set a filter on the subform programmatically, I've put the
following code in button click event:

With Me.subformcontrolname..Form
.Filter = "[Data] > #01/01/2000#" 'it's a date, but also tried to
filter with int values......always the same problem
.FilterOn = True
End With


Unfortunatelly I get the error:

The column prefix 'subformcontrolname'
does not match with a table name or alias name used in the query


If I put the same code in the subform (simply opening the subform as a form)
it works.

Only when I try to set the filter when the form<->subform relation is true,
it fails. I've tried to put the code either in the form or the subform
(obviuosly with proper changes) but still the same error.


Help!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top