Access-FE on SQL-db, multiuser.
I have a mainform (invoices) with some 15 combo's in which user selects data (f.e. invoicesender, invoicereceiver, paymentterms etc)
There is a subform (invoicelines) that is linked to the mainform (on InvoiceID, master/child). The recordsource of the subform is a SQL-view that is a little bit sluggish, (because of some function that checks the state of the invoiceline against stock. I don't see a way to speed that up. The subform being a bit slow is not a real problem, there is a slight delay - around 2sec - on opening the invoiceform which is sufficient
Except:
All 15 combo's have a Enter() and Exit() event that set the combo.rowsource to:
- On combo Enter() "select * from tblCombo WHERE inactive=false"
- On Combo Exit*() "select * from tblCombo"
This way users can only select active values when they open the combolist, but the combo is able to display historic values that are not active anymore and should not be chosen anymore.
The problem is: setting the rowsource of any of the combo's in the combo Enter()/Exit() through VBA fires the subform.Current() event twice, and after or before that (I don't know) the subform refreshes - at least once.
So on any of the combo's entering or exitting it the forms is busy refreshing the subform and I'm getting a 2sec delay.
The rowsources of some the combo's are very small (f.e. select * from tblPayTerm) = 6 records) so that's not the delay.
The subform has no link to the combo's whatsoever, only a master/child link to display the Invoicelines for the invoice. There is no code in the mainform that does anything to the subform. When I disabled the combo.rowsource="select..." in the Enter/Exit (and leave other code on) the subform does not refresh anymore.
I have one combo that does not have a need for the enter/exit rowsourceadjustment, that does not fire the subform.current()
Why should the subform be refreshed? Is there a way I can disabled it? workaround?
I have a mainform (invoices) with some 15 combo's in which user selects data (f.e. invoicesender, invoicereceiver, paymentterms etc)
There is a subform (invoicelines) that is linked to the mainform (on InvoiceID, master/child). The recordsource of the subform is a SQL-view that is a little bit sluggish, (because of some function that checks the state of the invoiceline against stock. I don't see a way to speed that up. The subform being a bit slow is not a real problem, there is a slight delay - around 2sec - on opening the invoiceform which is sufficient
Except:
All 15 combo's have a Enter() and Exit() event that set the combo.rowsource to:
- On combo Enter() "select * from tblCombo WHERE inactive=false"
- On Combo Exit*() "select * from tblCombo"
This way users can only select active values when they open the combolist, but the combo is able to display historic values that are not active anymore and should not be chosen anymore.
The problem is: setting the rowsource of any of the combo's in the combo Enter()/Exit() through VBA fires the subform.Current() event twice, and after or before that (I don't know) the subform refreshes - at least once.
So on any of the combo's entering or exitting it the forms is busy refreshing the subform and I'm getting a 2sec delay.
The rowsources of some the combo's are very small (f.e. select * from tblPayTerm) = 6 records) so that's not the delay.
The subform has no link to the combo's whatsoever, only a master/child link to display the Invoicelines for the invoice. There is no code in the mainform that does anything to the subform. When I disabled the combo.rowsource="select..." in the Enter/Exit (and leave other code on) the subform does not refresh anymore.
I have one combo that does not have a need for the enter/exit rowsourceadjustment, that does not fire the subform.current()
Why should the subform be refreshed? Is there a way I can disabled it? workaround?