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

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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