Enabling fields

kevinh2320

Board Regular
Joined
May 13, 2016
Messages
61
I have three date fields on my form. The first date field OrderReceived is set to Enabled but the other two date fields OrderShipped and OrderDelivered are set to Disabled (Or, Enabled = No). I have two objectives. First, ensure that the date fields are filled out in the order the events occur. The code below seems to accomplish that. However, my second objective is to have the date fields remain enabled once a date is entered. This part I have not been able to figure out. Any assistance would be greatly appreciated.


Private Sub OrderReceived_AfterUpdate()

Me.OrderShipped.Enable = True

End Sub


Private Sub OrderShipped_AfterUpdate()


Me.OrderDelivered.Enable = True

End Sub
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I'm missing some pieces here, but have a hunch that this will work for you.
VBA Code:
Private Sub Form_Current()
    Me.OrderShipped.Enabled = Not IsNull(OrderReceived)
    Me.OrderDelivered.Enabled = Not IsNull(OrderShipped)
End Sub
If this does not work, I have a few questions.
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top