Continous sub-forms

KingBroil

Registered User.
Local time
Today, 18:41
Joined
Oct 3, 2012
Messages
41
Solved - Continous sub-forms

Hey, thanks for clicking this thread.

I have a navigation form [frmInvNav] on which I inserted one sub-forms [Inventaire] in the Continous Form format.

This sub-form takes it's data from a querry which assembles all the information from the MainInventory table. I use this sub-form as a search form. Each lines displayed on that sub-form has just the information from the table necessary to be able to identify the record.

What I try to do is to display the rest of the record's fields on the right of that sub-form when the focus is on a particular record in the sub-form. Look at attachement.
Either with another sub-form or textbox, doesn't matter. The closest I got to succede was with another continous sub-form with the same querry as source and applying a filter to point on the search sub-form current record. It works but always display the first record regardless of the field the focus is on.

I used:
Code:
Forms![frmGénNav]![frmInventaireNav].Form![NO_SERIE]
To point to the search sub-form's current record.

Anyway, do you regret clicking my thread now? Hahah.

I'm not a programmer or a good database builder but I just need a clue on where to look/start, or start over... anything even a good luck will be apreciated.

Thanks!
 

Attachments

  • Accesssss.jpg
    Accesssss.jpg
    96.7 KB · Views: 103
Last edited:
So that's the criteria of the second subform's query? Should work, but you'd have to requery the second subform in the current event of the first.
 
Yes, thanks. My two sub-forms are using the same querry so I assume that if I re-query, it will affect the results in both forms.

Should I do a duplicate querry so each sub-form has it's own source? (I didn't even try to consider this option since there is the word "duplicate" in it)

I have already considered using a filter instead of changing data source and don't remember where I stuck.. I will get back to it and post back.
 
Ah, then I'd probably reset the record source of the second subform, along the lines of:

FormReferenceHere.RecordSource = "SELECT * FROM QueryName WHERE KeyField = " & Me.KeyField
 
Ok, here's where I'm at. I try to use the filter method likie this:

Private Sub DESCRIP_1_Click()
Dim strRecord As String
strRecord = "[N°] = " & Forms![frmGénNav]![frmInventaireNav].Form![N°]
'msgbox strRecord
Me.[reqInvCarFin sous-formulaire2].form.Filter = strRecord
End Sub

Now, I get the error "2465". I cannot seem to point to the sub-form correctly.

I think that my main problem is understanding how the sub-forms works, like as a form in a control on a form, it gets complicateds for me when I try to code this so bear with me if you please..

How should I tell access to put the filter on the sub-form?
 
Ah! That feeling,

Private Sub DESCRIP_1_Click()

Dim strRecord As String

strRecord = "[N°] = " & Forms![frmGénNav]![frmInventaireNav].Form![N°]
Forms!frmGénNav!sfInvCarFin.Form.Filter = strRecord
Forms!frmGénNav!sfInvCarFin.Form.FilterOn = True

End Sub

Working like a charm.
 
Glad you got it working.
 

Users who are viewing this thread

Back
Top Bottom