M
mdullni1 via AccessMonster.com
MSAccess 2003 frontend, SQL Server 2000 Backend
Hi,
I have a form with 6 tabs. The following code is in Form_Current to ensure
the form goes to the first tab when moving to another record.
Private Sub Form_Current()
'*****************************************************************************
'* Sub: Form_Current
*
'* Purpose: Sets backcolor on fields for current record. Sets Current Record
*
'* label to name of current student.
*
'*****************************************************************************
Me.lblCrntRcrd.Caption = "Current Record: " & Me.LNm & ", " & Me.FNm & " "
& Me.MNm
'reset tab change flags
mblntabPrsnl_Set = False
mblntabRcEthn_Set = False
mblntabCtzn_Set = False
mblntabAddr_Set = False
mblntabSchl_Set = False
mblntabSOMRqrd_Set = False
If Me!TabCtlGradAdms.Pages(Me!TabCtlGradAdms.value).Name = "tabPrsnl" Then
'**if already on first tab, invoke set up for next record
Call TabCtlGradAdms_Change
Else
'Change to first tab which will invoke setup (recall Form_Current)
Me.TabCtlGradAdms.Pages(0).SetFocus
End If
Exit_StdExit:
Exit Sub
End Sub
Sometimes Form_Current is invoked without changing records. I want to trap
for that so this code is not executed, but when I add at the beginning:
If mlngAppID = me.txtAppID then
goto Exit_StdExit
end if
The process re-executes Form_Current everytime it hits this statement,
causing an infinite loop.
I have seen other posts where this kind of thing was done, but for some
reason anytime I reference a control on this tab (second tab) Form_Current is
invoked.
Can anyone explain why and tell me how to stop the loop?
Thanks
Hi,
I have a form with 6 tabs. The following code is in Form_Current to ensure
the form goes to the first tab when moving to another record.
Private Sub Form_Current()
'*****************************************************************************
'* Sub: Form_Current
*
'* Purpose: Sets backcolor on fields for current record. Sets Current Record
*
'* label to name of current student.
*
'*****************************************************************************
Me.lblCrntRcrd.Caption = "Current Record: " & Me.LNm & ", " & Me.FNm & " "
& Me.MNm
'reset tab change flags
mblntabPrsnl_Set = False
mblntabRcEthn_Set = False
mblntabCtzn_Set = False
mblntabAddr_Set = False
mblntabSchl_Set = False
mblntabSOMRqrd_Set = False
If Me!TabCtlGradAdms.Pages(Me!TabCtlGradAdms.value).Name = "tabPrsnl" Then
'**if already on first tab, invoke set up for next record
Call TabCtlGradAdms_Change
Else
'Change to first tab which will invoke setup (recall Form_Current)
Me.TabCtlGradAdms.Pages(0).SetFocus
End If
Exit_StdExit:
Exit Sub
End Sub
Sometimes Form_Current is invoked without changing records. I want to trap
for that so this code is not executed, but when I add at the beginning:
If mlngAppID = me.txtAppID then
goto Exit_StdExit
end if
The process re-executes Form_Current everytime it hits this statement,
causing an infinite loop.
I have seen other posts where this kind of thing was done, but for some
reason anytime I reference a control on this tab (second tab) Form_Current is
invoked.
Can anyone explain why and tell me how to stop the loop?
Thanks