I've been trying to wrap my head around this for a while and all the solutions I've found so far only deal with one checkbox for each textbox or weren't very clear. I'm not very good with vba and my school expects us to basically become experts and create a full system and documentation in the space of 5 months.
When UseDDelivery is checked the three textboxes should be disable and when the form is opened UseDDelivery is set to be checked by default so the textboxes should be disabled when the form opens but they aren't. the two different ways of doing it are shown below.
Elements specific to my system :
Solution 1:
This is a bit of vba a friend wrote for me quickly, it includes all three textboxes but the checkbox enables them instead of disables.
solution 2:
With this bit of vba I found the checkbox enables the textbox instead of disabling it and I can't figure out how to include the other two textboxes
When UseDDelivery is checked the three textboxes should be disable and when the form is opened UseDDelivery is set to be checked by default so the textboxes should be disabled when the form opens but they aren't. the two different ways of doing it are shown below.
Elements specific to my system :
UseDDelivery = checkbox
AltDeliveryAddress = textbox1
AltDeliveryTown = textbox 2
AltdeliveryPostcode = textbox3
AltDeliveryAddress = textbox1
AltDeliveryTown = textbox 2
AltdeliveryPostcode = textbox3
Solution 1:
Code:
Me.AltDeliveryAddress.Enabled = UseDDelivery.Value
Me.AltDeliveryTown.Enabled = UseDDelivery.Value
Me.AltDeliveryPostcode.Enabled = UseDDelivery.Value
solution 2:
Code:
Private Sub UseDDelivery_AfterUpdate()
If AltDeliveryAddress.Enabled = True Then
AltDeliveryAddress.Enabled = False
Else
AltDeliveryAddress.Enabled = True
End If
End Sub