Dear All,
I think the lockdown is getting to me and given me brain freeze.....
I have a cmd button on my main form "Purchase Orders" called tglRecieveAll.
On the main form is a subform set in datasheet view called "Purchase Order Subform".
On the subform footer is a calculated field called "SumQuantityReceived" which calculates fine and displays on the main form in another field.
When the value of the calculated field "SumQuantityReceived" = 0 I want to enable the cmd button "tglRecieveAll" on my main form. When the value of the field is >0 I want to disable the cmd button.
I have written the following code on my main form 'Current' procedure:
The code runs with no errors but it isn't disabling the cmb button as I want. Any ideas what I'm doing wrong? I can only assume that given its a calculated field I am referring to the value technically does not get passed?
I think the lockdown is getting to me and given me brain freeze.....
I have a cmd button on my main form "Purchase Orders" called tglRecieveAll.
On the main form is a subform set in datasheet view called "Purchase Order Subform".
On the subform footer is a calculated field called "SumQuantityReceived" which calculates fine and displays on the main form in another field.
When the value of the calculated field "SumQuantityReceived" = 0 I want to enable the cmd button "tglRecieveAll" on my main form. When the value of the field is >0 I want to disable the cmd button.
I have written the following code on my main form 'Current' procedure:
Code:
If Forms("Purchase Orders").[Purchase Order Subform].Form.SumItemsReceived.Value = 0 Then
Me.tglReceiveAll.Enabled = False
ElseIf Forms("Purchase Orders").[Purchase Order Subform].Form.SumItemsReceived.Value > 0 Then
Me.tglReceiveAll.Enabled = True
End If
The code runs with no errors but it isn't disabling the cmb button as I want. Any ideas what I'm doing wrong? I can only assume that given its a calculated field I am referring to the value technically does not get passed?