Actually I've already seen alike issues on this forum however I haven't found the right solution (at least with some code example)... anyway...
My task is to have a combined form where the header is normal form based on query, and the footer is a table-view form based on table. So, the header is so-called "Product Card" and the footer is so-called "Product List". The header should represent the selected record in the list.
The query, which is used by header (card) form, is actually built on the same table that footer (list form), with addition of some extra linked tables that just provide descriptions for some fields.
I'm trying to use the following code in Form_Current event of my footer (list) form:
Private Sub Form_Current()
Dim strCond As String
strCond = "[Product Name] = Forms!frmProductInput_list![Product Name]"
If IsLoaded("frmProductAuthorize") Then
Forms![frmProductAuthorize].FilterOn = True
Forms![frmProductAuthorize].Filter = strCond
End If
End Sub
where frmProductInput_list is footer (list) form and frmProductAuthorize is header (card) form. And "Product Name" is field present in both form, by which I'm trying to do filtering.
So, when I launch the form it shows me input dialogue to enter "Forms!frmProductInput_list!Product Name". The same message appears every time I go through records in my footer (list) form. If I enter any existing Product Name to it - yes, it will display me the right header (card). If I enter wrong or leave blank - the header will become empty.
Of course, I understand I'm close to the solution, but I don't want these input dialogues appear to enter filtering parameter every time I open the form or go through records. I just want header form to be automatically updated every time I select another record in footer form. In other words, filtering parameter from the footer should be automatically transferred to the header.
What's wrong about my code? (btw, taken from MS Access Help)
Thanks.
My task is to have a combined form where the header is normal form based on query, and the footer is a table-view form based on table. So, the header is so-called "Product Card" and the footer is so-called "Product List". The header should represent the selected record in the list.
The query, which is used by header (card) form, is actually built on the same table that footer (list form), with addition of some extra linked tables that just provide descriptions for some fields.
I'm trying to use the following code in Form_Current event of my footer (list) form:
Private Sub Form_Current()
Dim strCond As String
strCond = "[Product Name] = Forms!frmProductInput_list![Product Name]"
If IsLoaded("frmProductAuthorize") Then
Forms![frmProductAuthorize].FilterOn = True
Forms![frmProductAuthorize].Filter = strCond
End If
End Sub
where frmProductInput_list is footer (list) form and frmProductAuthorize is header (card) form. And "Product Name" is field present in both form, by which I'm trying to do filtering.
So, when I launch the form it shows me input dialogue to enter "Forms!frmProductInput_list!Product Name". The same message appears every time I go through records in my footer (list) form. If I enter any existing Product Name to it - yes, it will display me the right header (card). If I enter wrong or leave blank - the header will become empty.
Of course, I understand I'm close to the solution, but I don't want these input dialogues appear to enter filtering parameter every time I open the form or go through records. I just want header form to be automatically updated every time I select another record in footer form. In other words, filtering parameter from the footer should be automatically transferred to the header.
What's wrong about my code? (btw, taken from MS Access Help)
Thanks.