Enabling fields

kevinh2320

Board Regular
Joined
May 13, 2016
Messages
59
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
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

dataluver

Active Member
Joined
Jan 17, 2020
Messages
397
Office Version
365
Platform
Windows
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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,855
Messages
5,507,733
Members
408,647
Latest member
Nicho la zido

This Week's Hot Topics

Top