S
Steven M. Britton
I have an Unbound Form, on that form I have a TabControl and a subform at is
a datasheet. The Subform is not on the tab pages, it sit below the tab
controls. In the OnChange Event of the Tab Control I have the below code
which extracts the Name on the tab and then redefines a query. That all
works fine, the problem is that the subform datasheet doesn't change to
reflect the new criteria of query unless I close and reopen the form. Can
someone point out what is missing.
thanks
Private Sub TabCtl0_Change()
Something = Me.TabCtl0.Value
Select Case Something
Case Is = 0
Something = Me.Page1.Caption
Case Is = 1
Something = Me.Page2.Caption
Case Else
MsgBox "ERROR"
End Select
CurrentDb.QueryDefs("qryLifecycleSpread").SQL = "SELECT & LongSQLstatment _
& "WHERE (((tblModels.ModelNum) = '" & Something & "')) " _
& "ORDER BY tblChanges.Date;"
Me.frmChanges.Requery
End Sub
a datasheet. The Subform is not on the tab pages, it sit below the tab
controls. In the OnChange Event of the Tab Control I have the below code
which extracts the Name on the tab and then redefines a query. That all
works fine, the problem is that the subform datasheet doesn't change to
reflect the new criteria of query unless I close and reopen the form. Can
someone point out what is missing.
thanks
Private Sub TabCtl0_Change()
Something = Me.TabCtl0.Value
Select Case Something
Case Is = 0
Something = Me.Page1.Caption
Case Is = 1
Something = Me.Page2.Caption
Case Else
MsgBox "ERROR"
End Select
CurrentDb.QueryDefs("qryLifecycleSpread").SQL = "SELECT & LongSQLstatment _
& "WHERE (((tblModels.ModelNum) = '" & Something & "')) " _
& "ORDER BY tblChanges.Date;"
Me.frmChanges.Requery
End Sub