Current event on different sub-forms

KingBroil

Registered User.
Local time
Today, 17:50
Joined
Oct 3, 2012
Messages
41
Hello,

Simple problem: I have a form with 2 continous sub-forms. One used as a search form and the other to show related information. I use this code to filter the 2nd sub-form based on the 1st sub-form' selection.

Code:
strRecord = "[N°] = " & Forms![frmGénNav]![subfrm1].Form![N°]
'msgbox strRecord
Forms!frmGénNav!subfrm2.Form.Filter = strRecord

Forms!frmGénNav!sfInvCarFin.Form.FilterOn = True

So this works once the main form is fully loaded but on initial launch, it gives an error code: Runtime Error 2455

I guess that the Current event occur before all the controls on the main form are even loaded, so way too fast. I do not see on what other event I could put the code since I need to re-filter every time someone clicks on a record, on any fields. I tried the on click event but it only works if I click on the headers at the left of the record lines.
I'm sure I can come up with a work around for this but since getting something done in VBA takes a real long time for me, I just need an advice on what direction to take from here.

Thanks for even taking the time to read this!
 

Users who are viewing this thread

Back
Top Bottom