A
Alexander Jagl
Hi!
In a main form I've placed a subform with a vertical scrollbar to view
all the contents of the subform.
The subform consists mainly of textfields, next to each textfield I've
placed a button which opens a dialog-form where the user can select one
or more pre-defined strings. Then I use a SQL-Statement "UPDATE..." to
update the table. After this I refresh the subform with
Forms("MainForm").Form("SubForm").Form.Refresh
As a result of this code the position of the subform is set to 0/0, so
if the user is working with a textfield in the lower region of the
subform he will have to use the vertical scrollbar to get back to this
textfield.
With
Forms("MainForm").Form("SubForm").Form.Controls("Textfiels").SetFocus
I'm able to set the focus to the textfield, but then the textfield is
positioned at the bottom of the subform and not at the relative position
it had before the call of refresh.
Is there a way to get the relative position of the subform?
(Or the position of the scrollbar in pixels?)
(It is not possible to set the new data directly to the textfield with
Forms("MainForm").Form("SubForm").Textfield.value = "newValue", because
I use varchar field and there is a limitation with textfields in
access-forms so there are only 256 characters allowed. Therefore I have
to use the "UPDATE..." statement.)
Thanks,
Alex
SQL Server 2000, SP 3
Access XP ADP, SP 2
In a main form I've placed a subform with a vertical scrollbar to view
all the contents of the subform.
The subform consists mainly of textfields, next to each textfield I've
placed a button which opens a dialog-form where the user can select one
or more pre-defined strings. Then I use a SQL-Statement "UPDATE..." to
update the table. After this I refresh the subform with
Forms("MainForm").Form("SubForm").Form.Refresh
As a result of this code the position of the subform is set to 0/0, so
if the user is working with a textfield in the lower region of the
subform he will have to use the vertical scrollbar to get back to this
textfield.
With
Forms("MainForm").Form("SubForm").Form.Controls("Textfiels").SetFocus
I'm able to set the focus to the textfield, but then the textfield is
positioned at the bottom of the subform and not at the relative position
it had before the call of refresh.
Is there a way to get the relative position of the subform?
(Or the position of the scrollbar in pixels?)
(It is not possible to set the new data directly to the textfield with
Forms("MainForm").Form("SubForm").Textfield.value = "newValue", because
I use varchar field and there is a limitation with textfields in
access-forms so there are only 256 characters allowed. Therefore I have
to use the "UPDATE..." statement.)
Thanks,
Alex
SQL Server 2000, SP 3
Access XP ADP, SP 2