show enabled and disabled

G

Guest

Hi All,

I have a subform "sfrm_Current_Qtr" on Main form "frm_Compliance_Accounts".
The subform is a done in datasheet view because depending on the record
showing on the main form, there could be up to five records showing in the
sfrm_Current_Qtr. One of the fields in the subform is "Archive". It is a
checkbox that is enabled or disabled depending on whether the "Compliant"
field is "No" or "yes". My problem arises when the subform has multiple
recordswith the Compliant field being "No" in one and "Yes" In another, then
the Archive field is either enabled or disabled on all of the filtered
records depending on what is showing first (yes or no).

Is there anyway to get the Archive field to show both enabled and disabled
if multiple records come up having Yes and no in the "compliant" field?

Here is the code I have thus far:

Private Sub Archive_AfterUpdate()

DoCmd.GoToControl "Action" ' This is used just to move the focus off the
the Archive field

End Sub

Private Sub Form_Current()

If Me.Compliant = "No" And (IsNull(Me.Action) Or Me.Action = 0) Then

Me.Archive.Enabled = False

Else

Me.Archive.Enabled = True

End If

End Sub

Thanks!
 
W

WAstarita

Unfortunately, you do not have much control over the datasheet view.
Even if you were using a continuous form, you will either enable or
disable the control perminently. The best you can do is conditional
formating, which will work on each record separately.

I would suggest controlling the user input via the Beforeupdate event
of the check box control.


If x = Some Value Then
Cancel = True
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top