×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

7 Control Situations

7 Control Situations

7 Control Situations

(OP)
Here is the situation,

I have 7 controls on this form.  I am trying to find out what type of syntax to use in order to do the following.

The first controls label asks the question.  
Is there a payment discrepancy? "Y" or "N" (are the two options for this 1 position control)

The other 6 controls will be filled in pairs of two if the answer is "Y".  For example:

Field 2:  Current Amount     Field 3: Current Amount Effect
Field 4:  Retro Amount       Field 5: Retro Amount Effect
Field 6:  Future Amount      Field 7: Future Amount Effect

If the first field is filled in with a "Y"  then Current Amount and Effect or Retro Amount and Effect or Future Amount and Effect must be filled in, one of the set of pairs must be code but not all pairs if the answer is "Y".  There can not be missed march combinations of the filled control.  Example:  Current Amount and Retro Effect can not be filled in together.  Current Effect and Retro AMount must also be filled in if this situation is to work. The amount and the effect must be coded together.  There can't be Current Amount with a Currenct Amount Effect.

Amounts are dollar values, and Effects are Alpha characters.

I hope that this make it clear.  I need to know what syntax to use to get the code to work as stated.

Please Help
Neaka

RE: 7 Control Situations

Hi,

Why not have grouped option buttons labled YES & NO for each pair of fileds.

Then depending on the state of the option button you either enable or disable the other fields and therefore allow/stop any user entry into those fields.

As an example
Is there a discrepancy O Yes  O No
O Yes  O No   [Field 1]  [Field 2]
O Yes  O No   [Field 3]  [Field 4]
O Yes  O No   [Field 5]  [Field 6]

each yes-no pair work together with each other but independent of the other pairs. However you may choose that the discrepancy O Yes  O No enables or disables the other controls & fields depending on what you select. As can the other YES/NO controls.

To get the logic right you need to state all the conditions i.e. if first pair = yes then what must be enabled
if second pair = yes then what must be enabled

A sample piece of code for the above is

Private Sub Option1_Click()
Amount.Enabled = True
Effect.Enabled = True

Amount2.Enabled = True
effect2.Enabled = True
End Sub

Private Sub Option2_Click()
Amount.Enabled = False
Effect.Enabled = False

Amount2.Enabled = False
effect2.Enabled = False
End Sub



Where Option1 = YES button and Option2 = NO button of the Discrepancy question.

Selecting yes enables the other fields, selecting no disables them.

Any help ?, yes no let me know.

Regards

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources