candidesh
candidesh

Reputation: 11

Why in subform2 the event Form_Current with a requery command is not fired when called by subform1

I have 2 subforms. When focus changes on sfrm1 I want to requery sfrm2 which is only to display data not editing.

In sfrm1, event Form_Current I do the requery:

Me.parent.Controls![ctlsfrmShowLos].Requery

In sfrm2 event Form_Current I update the string for the recordsource:

Me.RecordSource = "SELECT * " & _
" FROM [dbo_Los] " & _
" WHERE [losklkID] = " & gMyClsTempVars_frmChartKalkulation.prpTempVar(gclngTV_FrmChartKalkulation_KalkID) & _`
" ORDER BY 1"

This works as long as there are rows for subform2.

While debugging I can see: when there are no rows for subform2 then the line with the requery in sfrm1 is NOT firing the OnCurrent event in sfrm2.

enter image description here

VBA yellow line does not fire when sfrm2 has no rows

why?

It could have something to do with the form recordsettype = snapshot which I also chose to NOT display the new record line.

Not sure what to change as the code works as long there are rows in subform2.

Upvotes: 1

Views: 31

Answers (0)

Related Questions