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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return field type 1

Status
Not open for further replies.

streetprog

Technical User
Nov 9, 2006
41
US
I've tried searching through the EXTRA library for this, but haven't found what I'm looking for. Is there a way for EXTRA to return the field type of the current cursor position. In the Settings - Colors, you can see the names of these fields: UnprotectedNormal, UnprotectedHigh, ProtectedNormal, ProtectedHigh.

What I'm aiming at is if the user has their cursor in a Protected field and tries to run the macro and the .SendKeys is used, it will pop up a msgbox and exit sub. Otherwise, it will lock up their session with the little man next to the X (maybe that is the ...OIA.XStatus = 3 aka xPROTECTED_FIELD).

That cursor position may be protected at times and unprotected at times so I can't rely on just where the cursor is. Thanks!
 
I'd use Putstring(string,row,column) vs using sendkeys
then you know exactly where the text will be input on the screen.



[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks for replying. I've never used the PutString function, but I think that will work better than using .MoveTo and then .Sendkeys.

However, if the Field is currently protected, it won't allow that either. The user has to initiate the "add" mode to insert text or the field must be currently unprotected. They won't always have to be in "add" mode for the field to be unprotected. Does that make sense?
 
Don't have anything here that your describing as add mode

Maybee something like this would work

putstring("your info",row,column)
If getstring(row,column,len("your info")) <> "your info" then
inform user they're not in add mode
call closing sub
End If




[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I'll give it a try. What I meant by "add" mode is that in order to insert a comment, the user has to press "PF2". However, if there is already a comment, they can update that comment without pressing "PF2". So that's why sometimes the field is protected and othertimes not. I guess I could have given more info up front.

If anyone knows more about the fields, please chime in. Thanks for your help, Mr. Wilson!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top