How do I selectively disable an option group?

J

John Morrissey

I have a form with an option group. The form displays two
types of data. I want to enable the option group to make
a decision about one type of data. When the other type of
data are displayed, I want to disable or dim the option
group. The data are sorted so the case lines involving the
option group data are displayed first, then the other data
are displayed.

There are data fields in the table that feeds the query
that feeds the form that I can use to make the contingent
decision about whether the option group should be
displayed or disabled for each case line.

Example: The form has fields to display "customer
name", "order date", "order number", "order
amount", "refund request", "refund request date", "refund
amount".

The form has the "Refund Request" option group. When the
case line being displayed contains a request for refund,
the user has the choice of "Refund allowed" or "Refund
denied."

When the form displays a line with "customer name", "order
date", "order number", and "order amount" but NOT "refund
request", dim the "Refund Request" option group.

When the form displays a line with "customer name", "order
date", "order number", "order amount", "refund
request", "refund request date" and "refund amount"; make
the "Refund Request" option group visible.

The contingent variable could be any of the three refund
related field--choose "refund request" field.

THANKS!
 
W

Wayne Morgan

I thought I understood until I read the last line. However, to
enable/disable the option group depending on criteria in records that
already exist, in the form's Current event you would use something like

If Not IsNull(Me.txtRefundRequest) Then
Me.optRefundRequest.Enabled = True
Else
Me.optRefundRequest.Enabled = False
End If

In your last line, you indicated that you may want to tie some more
fields/controls into the decision, is this correct?
 
G

Guest

I was not clear. I meant to say any of the three fields
would work and I arbitrarily selected one. In my example,
for any case line, if one of these three fields has data
in it, the other two have data as well. On the other
hand, if this field is null, then the other two are null
as well.

THANKS!
 

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