Validation rule

CData
3StarLounger
Posts: 308
Joined: 24 Dec 2015, 16:41

Re: Validation rule

Post by CData »

well the dataview and continuous style form objects are the least flexible. you might consider pop up of an entry form that is single style.
or put entry fields into the header section of a continuous form. then in the AfterUpdate event you can control field properties i.e.
If me.order = "buy" then
me.profit = 0
me.profit.enabled = false
end if

bknight
BronzeLounger
Posts: 1374
Joined: 08 Jul 2016, 18:53

Re: Validation rule

Post by bknight »

Well your suggestion got me to experimenting; part of Private Sub ActionID_AfterUpdate()

Code: Select all

        If Me.ActionID = 46 Or Me.ActionID = 48 Then
            Me.Profit.Locked = True
        Else
            Me.Profit.Locked = False
        End If
Works good as far as I tested.
Thanks

CData
3StarLounger
Posts: 308
Joined: 24 Dec 2015, 16:41

Re: Validation rule

Post by CData »

depending on how things are arranged; you may need to lead that code with
Me.Profit.Locked = False

as the profit field will be left with whatever property is applied