Link to home
Start Free TrialLog in
Avatar of sirbounty
sirbountyFlag for United States of America

asked on

my text_Change runs twice...how can I stop this?

Inside that routine, I have something along the lines of

If instr(1,txtinfo(1).text, "A")) =0 and instr(1,txtinfo(1).text, "B")) =0 Then
txtInfo(1).text = "A" & txtinfo(1).text
blah blah blah of course change runs again - not a biggie as the code runs okay, but pointless nonetheless...
Avatar of Harisha M G
Harisha M G
Flag of India image

Hi sirbounty,
    You are changing it withing _Change event

Bye
---
Harish
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sirbounty,
    my mistake...

If (Not Running) And (InStr(1,txtinfo(1).Text, "A") =0) And (InStr(1,txtinfo(1).Text, "B") =0) Then
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
AzraSound,
    Yes.. of course... it will prevent the appending of "A" which is the main requirement here. :)
Didn't read what he was doing...a boolean would work okay here (or maybe you can do your handling in another event).
Avatar of sirbounty

ASKER

Hey guys - good info above.  just want to detail what I'm doing...

User will copy a number from another program.  I want that when it's pasted to my form, it'll be preceeded with an "A" if not already (the originating number doesn't have the "A", but some folks add it before pasting it).

Anyway - I'm going to close this one - I've found another bug that is going to basically eliminate this as an issue anyway...thanx for the input. :^)