J
Jen
I try to open a mainform (frm_fakturainmatning) and it's subform
(frm_fakturarader_subform) from a startform (frm_startform) and filter the
mainform based on value of textfield in the subform (txt_forklaring).
On the startform (frm_startform) I have an unbound textbox
(txt_bladdra_per_fritext), and based on the value in this textform I want to
filter the mainform (where matches are found in the mainforms subform's
(txt_forklaring) fields). I pass the value like this:
stLinkCriteria =
"forms!fakturainmatning!fakturarader_subform.Form!forklaring Like '*" &
[Forms]![startform]![txt_bladdra_per_fritext] & "*'"
The system can't find the subforms textfield txt_forklaring. I guess that is
because the field forklaring isn't in the recordsource of the mainform. If I
put it there and change the stLinkCriteria accordingly then the filter
works, but then the mainform cykles through all the records in the subform
(the subform is datasheet and holds several records on the/ per mainform).
The mainforms recordsource/ query is bound to 3 tables. The subform
recordsource/ query is bound to its own table ("tbl_fakturarader", limked to
the tables in the recordsource/ query for the mainform).
I'm sorry that I can't explain this better in english, I know it could be
hard to understand what I'm trying to explain. Please ask for clarification
and I will do my best to answer you. Any help on how to filter mainform
based on value in (linked) subform would be wery appreciated.
Jen
(frm_fakturarader_subform) from a startform (frm_startform) and filter the
mainform based on value of textfield in the subform (txt_forklaring).
On the startform (frm_startform) I have an unbound textbox
(txt_bladdra_per_fritext), and based on the value in this textform I want to
filter the mainform (where matches are found in the mainforms subform's
(txt_forklaring) fields). I pass the value like this:
stLinkCriteria =
"forms!fakturainmatning!fakturarader_subform.Form!forklaring Like '*" &
[Forms]![startform]![txt_bladdra_per_fritext] & "*'"
The system can't find the subforms textfield txt_forklaring. I guess that is
because the field forklaring isn't in the recordsource of the mainform. If I
put it there and change the stLinkCriteria accordingly then the filter
works, but then the mainform cykles through all the records in the subform
(the subform is datasheet and holds several records on the/ per mainform).
The mainforms recordsource/ query is bound to 3 tables. The subform
recordsource/ query is bound to its own table ("tbl_fakturarader", limked to
the tables in the recordsource/ query for the mainform).
I'm sorry that I can't explain this better in english, I know it could be
hard to understand what I'm trying to explain. Please ask for clarification
and I will do my best to answer you. Any help on how to filter mainform
based on value in (linked) subform would be wery appreciated.
Jen