noboffinme
Registered User.
- Local time
- Today, 21:12
- Joined
- Nov 28, 2007
- Messages
- 288
Hi
I have a form (main) containing a subform (question) with 2 text box controls (Q_1 & H_1).
On every Click & After Update event on either of these textboxes values are passed to textboxes on the main form, these values ensure other subforms select the correct records pertaining to the subform.
All is fine apart from the code seems to force the focus to end up in the first textbox 'Q_1' after the events.
Adding code to the 'H_1' to setfocus to it is overidden by this pass value code as when I remove it, the form naturally works normally.
The user experience is that they move from the 'Q_1' field to the 'H_1' field to enter data & the code moves the cursor back to the 'Q_1' field.
Only using tab will move the cursor to the 'H_1' field.
How can code that just passes values have this effect on a cursor behaviour??
Here's the code to pass the values;
Note - 'main_q_no' sits on the main form & has its value set
Forms!frm_main.main_q_no = Me.Q_1
Forms!frm_main.main_q_id = Me.q_id
Adding a Setfocus back to the correct field will only last until the code runs & the cursor jumps back to 'Q_1' every time, Adding Me.NextTextBox also doesn't help.
Thanks
I have a form (main) containing a subform (question) with 2 text box controls (Q_1 & H_1).
On every Click & After Update event on either of these textboxes values are passed to textboxes on the main form, these values ensure other subforms select the correct records pertaining to the subform.
All is fine apart from the code seems to force the focus to end up in the first textbox 'Q_1' after the events.
Adding code to the 'H_1' to setfocus to it is overidden by this pass value code as when I remove it, the form naturally works normally.
The user experience is that they move from the 'Q_1' field to the 'H_1' field to enter data & the code moves the cursor back to the 'Q_1' field.
Only using tab will move the cursor to the 'H_1' field.
How can code that just passes values have this effect on a cursor behaviour??
Here's the code to pass the values;
Note - 'main_q_no' sits on the main form & has its value set
Forms!frm_main.main_q_no = Me.Q_1
Forms!frm_main.main_q_id = Me.q_id
Adding a Setfocus back to the correct field will only last until the code runs & the cursor jumps back to 'Q_1' every time, Adding Me.NextTextBox also doesn't help.
Thanks