Solved default cursor position

quest

Member
Local time
Tomorrow, 00:33
Joined
Nov 26, 2024
Messages
56
Hi,
I have split form. On opening default cursor position is on the first combo box in form header. Can default cursor position be in the first field instead.
thanks
 
Look at the Tab Order. You can just push the button to reset and the controls will be renumbered in their visible order. And/Or just change the tab order value to 0 for the control you want to have the focus when the form opens. The focus always opens in the lowest tab order control that is capable of receiving focus.

It's always good practice to fix up the tab order after you modify a form in any event.
 
You would want to look at your Tab Order.
 
You would want to look at your Tab Order.
that dont fix the problem. because it is split form combo boxes are in the form header and fields are in the detail. so with tab order are ordered combo boxes or fields depend where you are. in Continuous form default cursor position is in the first field.
 
Last edited:
The split form has nothing to do with the starting cursor position.

Having a form open with focus in a modifiable field is seriously dangerous. Most people would ask how to stop that rather than how to do it but whatever. In the Form's Open event, set focus to whatever control you want the cursor in.
 
Or reset the focus via the form's Current event if this is something that you need after each Save or Navigate action.
 
Or reset the focus via the form's Current event if this is something that you need after each Save or Navigate action.
i can work without changing anything, but i want to work with less clicking. maybe i wasnt clear enough i dont want to set focus on control but to field. cursor is by default on control no need to change that if i dont put it on field. and i need focus only on load (opening the form). why is opening form with focus on field dangerous. in continuous form default cursor position is on a field.
 
Last edited:
What in your mind is the difference between a "control" and a "field"? I explained how focus works. And you had two suggestions of how to do what you asked but now you're saying that isn't what you want because you think "control" and "field" are different in this context.

If your tab order is correct, the user can tab to the first data entry field although that makes sense only if somehow the first record displayed is always the one the user wants to edit.

If the combos are unbound and used for searching, seems to me that it makes far more sense for focus to be in the combo when the form opens.
 
What in your mind is the difference between a "control" and a "field"? I explained how focus works. And you had two suggestions of how to do what you asked but now you're saying that isn't what you want because you think "control" and "field" are different in this context.

If your tab order is correct, the user can tab to the first data entry field although that makes sense only if somehow the first record displayed is always the one the user wants to edit.

If the combos are unbound and used for searching, seems to me that it makes far more sense for focus to be in the combo when the form opens.
maybe i don't know to speak with terms. when i speak of a control i mean about combo boxes. yes combo boxes are used for searching but i use form first for entering data later when needed for searching. so it seems more convenient to me to open to filed ready for entering data. and i tried with Me.fieldname.SetFocus. not success. what i do wrong.
 
Controls are all the "thingies" you put on a form. That includes textboxes, combos, listboxes, checkboxes, subforms, tab controls, etc, etc, etc. Even labels are controls.

If you use a menu or switchboard form to open other forms, you can give the user two options. Open for add or open for edit. No need to change the form. You just control how you want it to behave when you open it.
 
i took another approach. add go to new record and now is solved. thanks for all suggestions.
 
i put code after opening form on load event is that what is wrong?
How do I know? How can anyone know? You didn't post the exact code you used. For all we know it has typos in it. Whenever you want someone to assess your code problem, you MUST post the exact code you used. Do not type it in the little box. Copy it from your code module and paste it. Otherwise we have no shot at coming up with an answer.

And, again. I told you how you can open the form two different ways without relying on code in the form.
i took another approach. add go to new record and now is solved. thanks for all suggestions.
Adding a button is fine but clicking on the * at the bottom of the form works without any code.
 

Users who are viewing this thread

Back
Top Bottom