Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Code for Selection Detection

Status
Not open for further replies.

Tobin1

Petroleum
Joined
Nov 9, 2007
Messages
176
Location
US
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
 
Never Mind, I figured it out.
It occurred to me just as I was falling asleep. :-)

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
 
This would be a good opportunity to experiment with the various events associated with textbox: Change, KeyPress/Up/Down, Before/AfterUpdate, Enter, etc.

[bat]Honesty may be the best policy, but insanity is a better defense.[bat]
-SolidWorks API VB programming help
 
TheTick

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

Thanks

Tobin Sparks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top