Question Requery not firing on "On Click" (1 Viewer)

jepoysaipan

Registered User.
Local time
Tomorrow, 05:26
Joined
Nov 4, 2007
Messages
133
Hi,

As usual I am here again to seek help and guidance to the Masters :).

Ok, I'm using Access 2K7, I have an unbounded "Main Form" which houses a Tab with 4 pages, on each pages is a datasheet subform.

Now I wanted that when every time I switch pages the datasheet be requeried, I tried putting the Forms!mysubform.requery on each pages on the "On Click" event but it doesn't trigger, but when I created a command button which I store all the requery on my pages it works like magic :(

The reason why I want to requery the datasheets is that whenever I selected a data on any datasheet it will open a separate form for editing/adding/deleting the record, so I have to requery the record to update the datasheets on my tab.

Am I missing something?

Thanks again for all your help.

Jeff


 

datAdrenaline

AWF VIP
Local time
Today, 14:26
Joined
Jun 23, 2008
Messages
697
Use the OnChange event of the tab control ... then use a Select..Case construct to direct your code appropriately ...

Code:
Private Sub tabTabControlName_Change()
    
    Select Case Me.tabTabControlName.Value
    
        Case Me.pgATabPageName.PageIndex
            Me.mySubFormControl.Requery
    
        Case Me.pgAnthorTabPageNaem.PageIndex
            Me.myOtherSubFormControl.Requery
    
    End Select
    
End Sub

The Page's OnClick event will only fire if you click in the space that is designated for controls on that page AND transparency if OFF!

The TabControls' OnClick event fires when you click on the tab control itself (not a page) ... for example the "grey" space to the right of the right most tab of a "standard" looking tab control ...
 

jepoysaipan

Registered User.
Local time
Tomorrow, 05:26
Joined
Nov 4, 2007
Messages
133
Hi datAdrenaline,

Thanks for this quick and meaningful solution for my problem, It works perfect!

Cheers!
 

Users who are viewing this thread

Top Bottom