Snowflake68
Registered User.
- Local time
- Today, 00:06
- Joined
- May 28, 2014
- Messages
- 464
I have a check box with the code below on the After Update event however not all of the code runs when the check box = False (unticked) I have placed message boxes to test to see which parts of the code are running and the odd thing is that the Else part does appear to run but it doesnt fire the message up nor does it continue with the next part of the code to check values A.
Code:
Private Sub chkShipTo_AfterUpdate()
If chkShipTo = vbTrue Then
txtShipToDetails.Visible = True
cboShipTo = Null
cboShipTo.Enabled = False
txtShipToDetails.Enabled = True
txtShipToDetails.SetFocus
MsgBox "TRUE"
Else
txtShipToDetails.Visible = False
cboShipTo.Enabled = True
cboShipTo.Value = cboBillTo.Value
txtShipToDetails = Null
cboShipTo.SetFocus
'Codes appears to run up to this point as the controls are enabled and hidden etc but but the message box doesnt pop up and doesn't continue with checking the next part of the code (which I have omitted for simplicity but just put a message box to check where things have go to)
Also I have a text box called cboShipTo that I need to requery before I check the Values but that doesnt update unless I requery the actual check box and then this only updates when the check box is True. I am very baffled with this one. :banghead:
MsgBox "FALSE"
End If
MsgBox "Continue"
chkShipTo.Requery
cboShipTo.Requery
End Sub