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!

EIP - Can I map the enter key as tab and disable EIP save? 1

Status
Not open for further replies.

emaduddeen

Programmer
Mar 22, 2007
184
US
Hi Everyone,

In the "Global Properties" of my app in the "App Settings" tab "Use ENTER key intead of TAB" is selected, but when the user presses the ENTER key on a browse that has EIP enabled this setting is ignored. I even place an ALIAS statement in the "TakeAccepted" and "open window" embed in one of the entry controls of the embed to force the ENTER key to be mapped as a TAB key.

None of this workes. Can you tell me what else I need to do to get this to work?

Here is the code I used in the embed.

Code:
! Calculate discount if sell price is < 0.
!-----------------------------------------
Update() ! Ensure browse fields are refreshed.

If Queue:Browse.TranDet:SellPrice < 0 |
Then
   Queue:Browse.TranDet:DiscountAmount = ((Queue:Browse.TranDet:RegularPrice * Queue:Browse.TranDet:SellPrice) / 100)

   Queue:Browse.TranDet:SellPrice = Queue:Browse.TranDet:RegularPrice + Queue:Browse.TranDet:DiscountAmount

   Queue:Browse.TranDet:DiscountAmount = (Queue:Browse.TranDet:RegularPrice - Queue:Browse.TranDet:SellPrice)
End

!message(keycode())

Update() ! Ensure browse fields are refreshed.

Alias (EnterKey, TabKey)

Thanks.
Emad
 
Hi Emad,

You need to trap the TakeEvent method of every Edit Object of the editable columns (except the last one) of the browse and do this before the parent call :

IF E = EVENT:AlertKey AND KEYCODE() = EnterKey
SETKEYCODE(TabKey)
END

OR (if the above fails)

IF E = EVENT:AlertKey AND KEYCODE() = EnterKey
RETURN EditAction:Forward
END

Regards
 
Hi ShankarJ,

Thanks for the code examples.

Truly,
Emad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top