×
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

Macro Code for Selection Detection

Macro Code for Selection Detection

Macro Code for Selection Detection

(OP)
Howdy All,

I've attached a Macro that I need some help with.

This is just a "see if I can do it this way" kind of Macro.
The form has three TextBoxes and I want to detect if the user has put any text in them, then, only use the TextBoxes that have text in them to create one SW Note.

I have commented the Macro to further explain the problem.

Can anybody help or show me some other simple way to do this?

Tobin Sparks
www.nov.com

RE: Macro Code for Selection Detection

(OP)
Never Mind, I figured it out.
It occurred to me just as I was falling asleep. smile

For anybody interested I just changed the following:

If Len(TextBox1.Text) > 0 Then Settings(0) = 1 Else Settings(0) = 0
If Len(TextBox2.Text) > 0 Then Settings(1) = 1 Else Settings(1) = 0
If Len(TextBox3.Text) > 0 Then Settings(2) = 1 Else Settings(2) = 0

Tobin Sparks
www.nov.com

RE: Macro Code for Selection Detection

This would be a good opportunity to experiment with the various events associated with textbox: Change, KeyPress/Up/Down, Before/AfterUpdate, Enter, etc.

batHonesty may be the best policy, but insanity is a better defense.bat
http://www.EsoxRepublic.com-SolidWorks API VB programming help

RE: Macro Code for Selection Detection

(OP)
TheTick

Thanks for your responce. That sounds like a good idea. I'll check it out.

Thanks

Tobin Sparks
www.nov.com

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