This is a bit complicated, and I'm not sure if I can explain it correctly.
I have a continuous form from which a user can look up a SKU and get to the forms that apply to that product number at that point in time, to sort of get an idea of the history of that SKU (each detail of the continuous form corresponds to a specific date that a count was done on that product). Sometimes, there is a recount form that is available for that cycle count, and I have a command button in the details area so that the form relevant to the count performed on a particular date can be viewed. However, if the user clicks this button and there is no form available for this particular date/SKU combination, all kinds of errors pop up, and I need to avoid this if possible.
This is determined by whether or not there is a value in the 'Count1' field of the appropriate detail. I have the following code in the "Form_Load" event of the form:
The problem is that this is an all-or-nothing solution. If any of the Count1 boxes are null, then all of the resulting "OpenRecount" controls are disabled. "OpenRecount" only gets enabled if all the Count1s in all the details are not null.
This is not what I wanted: I want the OpenRecount button enabled only in the detail groups where there is a recount form available, not all-or-nothing.
Anyone have any ideas?
I have a continuous form from which a user can look up a SKU and get to the forms that apply to that product number at that point in time, to sort of get an idea of the history of that SKU (each detail of the continuous form corresponds to a specific date that a count was done on that product). Sometimes, there is a recount form that is available for that cycle count, and I have a command button in the details area so that the form relevant to the count performed on a particular date can be viewed. However, if the user clicks this button and there is no form available for this particular date/SKU combination, all kinds of errors pop up, and I need to avoid this if possible.
This is determined by whether or not there is a value in the 'Count1' field of the appropriate detail. I have the following code in the "Form_Load" event of the form:
Code:
Private Sub Form_Load()
If Application.Nz(Me.Count1, "") = "" Then
Me.OpenRecount.Enabled = False
Else
Me.OpenRecount.Enabled = True
End If
End Sub
The problem is that this is an all-or-nothing solution. If any of the Count1 boxes are null, then all of the resulting "OpenRecount" controls are disabled. "OpenRecount" only gets enabled if all the Count1s in all the details are not null.
This is not what I wanted: I want the OpenRecount button enabled only in the detail groups where there is a recount form available, not all-or-nothing.
Anyone have any ideas?