Enter Key does not work in form

I have a main form which has 3 subform controls, each linked to another form. In the main form properties, InsertAllowed is set to ‘No’. Subform controls 1 and 2 are not editable. Subform control 3 is editable. When I run the form and enter data in Subform 3, I am able to pass control to the next field only using Tab or Arrow keys. There is no response to the Enter key. Any ideas why? Thanks. Pari Somasundaram.

Is it a tabular or a card form? Does the enter key not response at all the controls or only at one? Are you sure that your keyboard is not broken?

Do you have a button on the form, which has the property Default set to Yes? In that case, the Enter keypress will activate this button. John

quote:


Originally posted by reijer: Is it a tabular or a card form? Does the enter key not response at all the controls or only at one? Are you sure that your keyboard is not broken?


It is a tabular form. The enter key works on other similar forms where I have main-subform kind of forms. In this form, the enter key does not respond at any control. No, my keyboad is not broken. Pari Somasundaram

quote:


Originally posted by John Tegelaar: Do you have a button on the form, which has the property Default set to Yes? In that case, the Enter keypress will activate this button. John


I do have a button on the form. I tried setting its Default property to Yes. But when I run the form and hit the Enter key nothing happens. To activate the button, I need to click on it with the mouse. I tried running the form in debug mode. When I press the Tab key the program steps thru the code. When I press the Enter key, nothing happens. I know this problem is specific to this form because the Enter key functions in other forms. Pari Somasundaram.

Pari, If it is a tabular form(I am assuming not a lookup form) and you have 2 buttons that have a default property of yes(the OK button and your new button), it will not work. When you create the tabular forms using a wizard they get created with the Ok and Cancel buttons. The OK button has a default property set to Yes. Which works if the form is in lookup mode. But when it is not and there is another button(user defined) that has the default property set to yes, it will be ignored. As a test try removing the Ok button then running the form with your button being the only 1 with the default property set to yes. I believe it will work. Taylor McCartney Development Specialist CSB Systems tmccartney@csbsystems.com

quote:


Originally posted by tmccartney: Pari, If it is a tabular form(I am assuming not a lookup form) and you have 2 buttons that have a default property of yes(the OK button and your new button), it will not work. When you create the tabular forms using a wizard they get created with the Ok and Cancel buttons. The OK button has a default property set to Yes. Which works if the form is in lookup mode. But when it is not and there is another button(user defined) that has the default property set to yes, it will be ignored. As a test try removing the Ok button then running the form with your button being the only 1 with the default property set to yes. I believe it will work. Taylor McCartney Development Specialist CSB Systems tmccartney@csbsystems.com


Ther is no Ok and cancel buttons on my form. I only have a menu button called Group and a command button called Refresh. I tried setting the Default property of Refresh to Yes. Still the Enter key does not work. In subform Control#3 I need to enter data(tabular sub form). Here, it lets user navigate from one field to another using the Tab and Arrow keys, but I need the user to be able to hit enter and it should move to the next textbox. Pari.

You could export your object in txt-format and look for strange things. Maybe there is a default-button hidden under another control.

Ok I understand. Even though you are in the subform, on the main form there is a button with a default property set to yes. Navision will take this as an action to take when enter is pressed. Try this as a test. onDeactivate()//Main Form currform.yourbutton.enabled := false; onActivate()//main form currform.yourbutton.enabled := true; This will show you how Navision handles your situation. By doing this the result is the following. When you are in the subform, the button on the main form is no longer enabled which means navision will let you navigate through the fields as you would normally. By know means is this a solution to your problem, but rather an explanation of what is happenning. Cheers Taylor McCartney Development Specialist CSB Systems tmccartney@csbsystems.com