Card and list form

dn1980

New member
Local time
Today, 07:36
Joined
Sep 14, 2007
Messages
5
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.
 
you might not be able to put a sub-form in the footer, i'm not sure. It may need to go in the detail section.

However, if you base the main form on a query, and another form on a table (but usually another query), you can put the second form into the first. Access will ask you to show how the records in the main form correspond with records in the subform.

Then the subform automatically changes as the main form changes. with no code at all
 
Thank you. I've already tried this before. Really code is not needed at all, but the result is not I need - in case you mentioned you will have in your subform only one record displayed in table view, and when you scroll through records you always have synchronized main form and subform, however I need the list of records in the subform, where selected record displays the same information on card.
 

Users who are viewing this thread

Back
Top Bottom