I have an optionbox with 4 possibilities.
1 possibility is tricky so I warned the user and give them a way to cancel their choice. I have the following code:
Private Sub KaderOnderhoud_AfterUpdate()
tempValue = Me.KaderOnderhoud
End Sub
Private Sub KaderOnderhoud_BeforeUpdate(Cancel As Integer)
Dim check_flag As Boolean
check_flag = True
If tempValue = 1 Then
If Not Bevestigen("Weet u zeker dat u het abonnement wilt veranderen?" & vbNewLine & _
"Dit kan gevolgen hebben voor de eventueel reeds ingevoerde " & _
"onderhoudsabonnementen."
Then
check_flag = False
cancel = true
End If
End If
If check_flag Then
If Me.wb_OHvalue = 1 Then
Me.subFrmOHbijWerkbon.Visible = True
Else
Me.subFrmOHbijWerkbon.Visible = False
End If
End If
End Sub
the problem is, the program asked the question. But no matter what's the users interaction (true/false) the value becomes the new value.
anybody understand what's happen?
Thnx in advance,
gErard
1 possibility is tricky so I warned the user and give them a way to cancel their choice. I have the following code:
Private Sub KaderOnderhoud_AfterUpdate()
tempValue = Me.KaderOnderhoud
End Sub
Private Sub KaderOnderhoud_BeforeUpdate(Cancel As Integer)
Dim check_flag As Boolean
check_flag = True
If tempValue = 1 Then
If Not Bevestigen("Weet u zeker dat u het abonnement wilt veranderen?" & vbNewLine & _
"Dit kan gevolgen hebben voor de eventueel reeds ingevoerde " & _
"onderhoudsabonnementen."
check_flag = False
cancel = true
End If
End If
If check_flag Then
If Me.wb_OHvalue = 1 Then
Me.subFrmOHbijWerkbon.Visible = True
Else
Me.subFrmOHbijWerkbon.Visible = False
End If
End If
End Sub
the problem is, the program asked the question. But no matter what's the users interaction (true/false) the value becomes the new value.
anybody understand what's happen?
Thnx in advance,
gErard