Loading only the tab page you require for speed purposes

Naqibullah

Registered User.
Local time
Tomorrow, 01:50
Joined
Feb 7, 2013
Messages
86
Loading only the tab page you require and disable others to speed up forms opening

Hello Dear valued colleagues,

please help me out!!!

i have a form having too much data on it, so i have used a tab control to be convenient for data entry, but while opening this form it is too slow as all the tab pages are loaded at once, i have heard that while having a form having tab control, it is better to load only the tab page you require and disable all other tab pages to speed up form opening, but i don't know how to do it, can anybody help me do that.....Regards
 
Last edited:
Load a tab page, only when the tab is selected.
 
thanks for the response....
Yes exactly, but i dont know how to do that, please guide me
 
Can any body help me please, i am just stacked, i tried to find in Google but wasn't successful...
Regards
 
Thank you JHB,

I used the following code but it was a bit confusing so didn't work, if you kindly comment the code, in this post it is said use unbound sub form, i didnt understand, also i want to tell you that in every tab page, whatever fields are there, they are related to one table (a table having too many fields, that is why i divided them into multiple tab pages)

Regards

Private mIntCurTabPage As Integer

Private Sub TabCtl8_Change()
'Clear the SourceObject of subform on tabpage we're leaving
Select Case mIntCurTabPage
Case Me.TabCtl8.Pages("pgFirstPageName").PageIndex
Me.sfrmFirst.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgSecondPageName").PageIndex
Me.sfrmSecond.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgThirdPageName").PageIndex
Me.sfrmThird.SourceObject = vbNullString
Case Me.TabCtl8.Pages("pgFourthPageName").PageIndex
Me.sfrmFourth.SourceObject = vbNullString
End Select

Select Case Me.TabCtl8
Case Me.TabCtl8.Pages("pgFirstPageName").PageIndex
Me.sfrmFirst.SourceObject = "sfrmOrders"
Case Me.TabCtl8.Pages("pgSecondPageName").PageIndex
Me.sfrmSecond.SourceObject = "sfrmOrders2"
Case Me.TabCtl8.Pages("pgThirdPageName").PageIndex
Me.sfrmThird.SourceObject = "sfrmOrders3"
Case Me.TabCtl8.Pages("pgFourthPageName").PageIndex
Me.sfrmFourth.SourceObject = "sfrmOrders4"
End Select
mIntCurTabPage = Me.TabCtl8
End Su
 
The code assumes that you have a unbound subform on each tab as you set to show the correct subform when the tab is selected and the course is set to zero when you leave the tab.
 
Thank you JHB,
i was not successful in doing that, attached in this post please find my sample database, if it is possible please help me to do that
 

Attachments

You've to create subforms!
But first I think you've to read up Database normalization. A database is quite different from a spreadsheet, in a database you store the data vertical in a spreadsheet horizontal.
A good pointer of when you've to create a new (sub) table is when some fields in you table are empty.
An easy example is, in you table you've - NumberSon, NumberDaughter, I'm sure not all have both sons and daughters, so here you need a (sub) table!
 

Users who are viewing this thread

Back
Top Bottom