Can someone please help me with my code, I’m a bit confused. The code below is in the After_update of the tickbox control and On_current of the form. It works fine until another dropdown box has a value selected on the same form. This has nothing to do with the code below, so I don’t know why it effects it. The DateToStock.Default Value is where the problem is occuring.
Thank you in advance.
Private Sub Form_Current()
If Me.tickbox = True Then
With Me
.consignee.Enabled = False
.DateToStock.Enabled = True
.DateToStock.Visible = True
.DateToStock.DefaultValue = "Date()"
.dts.Visible = True ' label
.dtc.Visible = False ' label
.DateToConsignee.Enabled = False
.DateToConsignee.Visible = False
.DateToConsignee.DefaultValue = "Is Null"
End With
Else
With Me
.consignee.Enabled = True
.DateToStock.Enabled = False
.DateToStock.Visible = False
.DateToStock.DefaultValue = "Is Null"
.dts.Visible = False ' label
.dtc.Visible = True ' label
.DateToConsignee.Enabled = True
.DateToConsignee.Visible = True
.DateToConsignee.DefaultValue = "Date()"
End With
End If
End Sub
Thank you in advance.
Private Sub Form_Current()
If Me.tickbox = True Then
With Me
.consignee.Enabled = False
.DateToStock.Enabled = True
.DateToStock.Visible = True
.DateToStock.DefaultValue = "Date()"
.dts.Visible = True ' label
.dtc.Visible = False ' label
.DateToConsignee.Enabled = False
.DateToConsignee.Visible = False
.DateToConsignee.DefaultValue = "Is Null"
End With
Else
With Me
.consignee.Enabled = True
.DateToStock.Enabled = False
.DateToStock.Visible = False
.DateToStock.DefaultValue = "Is Null"
.dts.Visible = False ' label
.dtc.Visible = True ' label
.DateToConsignee.Enabled = True
.DateToConsignee.Visible = True
.DateToConsignee.DefaultValue = "Date()"
End With
End If
End Sub