I am trying to learn modules and while some of them tend to work others dont. I assumed you could per say nest different functions within a module without issue but advice and input is suggested as to any help to be provided.
Functions
Goal is to get the form to act based on input to show the user different tabs while at the same time when scrolling through past records the view will change back to the original. Currently with this setup the view does not change. However, if i manually do the vba into each before/after even of the item it tends to work fine. Can someone assist in telling me if I am going in the wrong direction?
thanks
mike
Code:
Option Compare Database
Private Sub Form_Current()
Call WindStreetDirectoryFunction
End Sub
Private Sub Frame189_BeforeUpdate(Cancel As Integer)
If Frame189 = 1 Then
txtQ17ic.Visible = True
Label197.Visible = True
Else
txtQ17ic.Visible = False
Label197.Visible = False
End If
End Sub
Private Sub IndividualorEntity_BeforeUpdate(Cancel As Integer)
Call IndividualorEntityFunction
End Sub
Private Sub IndividualorEntity_AfterUpdate()
Call IndividualorEntityFunction
End Sub
Private Sub WindStreetDirectory_Frame_AfterUpdate()
Call WindStreetDirectoryFunction
End Sub
Private Sub WindStreetDirectory_Frame_BeforeUpdate(Cancel As Integer)
Call WindStreetDirectoryFunction
End Sub
Functions
Code:
Function WindStreetDirectoryFunction()
If WindStreetDirectory_Frame = 1 Then
TabCtlIndividualorEntity.Visible = False
Frame24 = 0
Frame263 = 0
Frame116 = 0
Frame125 = 0
Frame133 = 0
Frame141 = 0
Frame149 = 0
Frame157 = 0
Frame165 = 0
Frame173 = 0
Frame181 = 0
Frame189 = 0
txtQ17ic = 0
Frame211 = 0
Frame219 = 0
Frame227 = 0
Frame235 = 0
Text243 = 0
Frame245 = 0
Frame253 = 0
Text261 = 0
ElseIf WindStreetDirectory_Frame = 2 Then
TabCtlIndividualorEntity.Visible = True
Else
End If
End Function
Function IndividualorEntityFunction()
If IndividualorEntity = 1 Then
Name_Insured___Individual.Visible = True
Named_Insured___Entity.Visible = False
ElseIf IndividualorEntity = 2 Then
Name_Insured___Individual.Visible = False
Named_Insured___Entity.Visible = True
Else
End If
End Function
Goal is to get the form to act based on input to show the user different tabs while at the same time when scrolling through past records the view will change back to the original. Currently with this setup the view does not change. However, if i manually do the vba into each before/after even of the item it tends to work fine. Can someone assist in telling me if I am going in the wrong direction?
thanks
mike