P
Peter Hallett
Form “frm_A†has a sub-form “sfrm_Aâ€. Both are bound to tables with the
usual one:many relationship. Form frm_A lists customers. Sub-form sfrm_A
lists their transactions. Both frm_A and sfrm_A have navigation bars
allowing customers and their transactions to be viewed and data to be
entered. To facilitate this, the focus is located by default in the sub-form
control that normally receives the first data input – say ‘Control_sfA’.
In straightforward cases, this works fine. As the main form navigation
buttons are used to move from customer to customer, and the sub-form
navigation buttons are used to move from transaction to transaction, the
cursor remains in the respective Control_sfAs, as required.
Certain customers are, however, associated with particular types of
transactions that require the display of additional information. This is
presented in an independent pop-up form, “frm_B†which is invoked from sfrm_A
and opened or closed appropriately as the main navigation buttons are used to
move from customer to customer. This again works fine but when frm_B, a
continuous form, is open, the focus resides on its first control and cannot
be returned to Control_sfA by any means that I can devise. Commands of the
form ‘Forms![frm_A]![sfrm_A].Setfocus’, or any variation thereof that the
compiler will accept in Sub Form_Open or Sub Form_Current of frm_B, do
nothing. The focus stubbornly remains on the first control of frm_B,
although it can be manually moved to Control_sfA, in sfrm_A, by clicking on
the latter.
Can anyone suggest a way of automatically retaining the focus in sfrm_A when
frm_B is open?
usual one:many relationship. Form frm_A lists customers. Sub-form sfrm_A
lists their transactions. Both frm_A and sfrm_A have navigation bars
allowing customers and their transactions to be viewed and data to be
entered. To facilitate this, the focus is located by default in the sub-form
control that normally receives the first data input – say ‘Control_sfA’.
In straightforward cases, this works fine. As the main form navigation
buttons are used to move from customer to customer, and the sub-form
navigation buttons are used to move from transaction to transaction, the
cursor remains in the respective Control_sfAs, as required.
Certain customers are, however, associated with particular types of
transactions that require the display of additional information. This is
presented in an independent pop-up form, “frm_B†which is invoked from sfrm_A
and opened or closed appropriately as the main navigation buttons are used to
move from customer to customer. This again works fine but when frm_B, a
continuous form, is open, the focus resides on its first control and cannot
be returned to Control_sfA by any means that I can devise. Commands of the
form ‘Forms![frm_A]![sfrm_A].Setfocus’, or any variation thereof that the
compiler will accept in Sub Form_Open or Sub Form_Current of frm_B, do
nothing. The focus stubbornly remains on the first control of frm_B,
although it can be manually moved to Control_sfA, in sfrm_A, by clicking on
the latter.
Can anyone suggest a way of automatically retaining the focus in sfrm_A when
frm_B is open?