J
Jerry
Hi,
I have a problem with a form I'm using for entering customer orders.
The main form ([Customer Orders]) contains customer info and 3 subforms;
1. [Orders] subform contains a list of orders for the current customer in
[Customer Orders].
2. [Order Details] subform contains details of the current order in [Orders]
subform.
3. [Availabitity] subform contains the results of a crosstab query which
shows remaining inventory available for orders.
The problem I'm having is with the [Order Details] subform. When I click on
a field to add or edit data in any of the records except the first record in
the subform, as soon as I release the mouse button, the focus moves back to
the first record - in both the [Order Details] and [Orders] subforms. It
seems that the form is being refreshed as soon as I move the focus to a new
record, but I can't see why. I do have code,which I'll list below, in the
AfterUpdate event of each textbox and combo in the [Order Details] subform
to immediately update the display in the [Availability] subform to reflect
changes in the [Order Details] subform. When I first set this up, I tried
doing this in the Current event of the subform, and had problems with
endless loops so moved it to the AfterUpdate event which seems to work fine
in the first record in the subform but not for any subsequent records. I've
tried commenting the code out, even deleting it, saving and reloading the
form, but the behavior persists. I've even tried deleting the subform from
the main form and recreating it. I can't find any other code associated
with any of the forms. The [Order Details] form works OK when run by itself
(not as a subform of [Customer Orders]). What am I missing?
Option Compare Database
Private Sub Color_AfterUpdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub
Private Sub quantity_afterupdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub
Private Sub size_afterupdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub
I have a problem with a form I'm using for entering customer orders.
The main form ([Customer Orders]) contains customer info and 3 subforms;
1. [Orders] subform contains a list of orders for the current customer in
[Customer Orders].
2. [Order Details] subform contains details of the current order in [Orders]
subform.
3. [Availabitity] subform contains the results of a crosstab query which
shows remaining inventory available for orders.
The problem I'm having is with the [Order Details] subform. When I click on
a field to add or edit data in any of the records except the first record in
the subform, as soon as I release the mouse button, the focus moves back to
the first record - in both the [Order Details] and [Orders] subforms. It
seems that the form is being refreshed as soon as I move the focus to a new
record, but I can't see why. I do have code,which I'll list below, in the
AfterUpdate event of each textbox and combo in the [Order Details] subform
to immediately update the display in the [Availability] subform to reflect
changes in the [Order Details] subform. When I first set this up, I tried
doing this in the Current event of the subform, and had problems with
endless loops so moved it to the AfterUpdate event which seems to work fine
in the first record in the subform but not for any subsequent records. I've
tried commenting the code out, even deleting it, saving and reloading the
form, but the behavior persists. I've even tried deleting the subform from
the main form and recreating it. I can't find any other code associated
with any of the forms. The [Order Details] form works OK when run by itself
(not as a subform of [Customer Orders]). What am I missing?
Option Compare Database
Private Sub Color_AfterUpdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub
Private Sub quantity_afterupdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub
Private Sub size_afterupdate()
[Form_Customer Orders]![Availability].Requery
[Form_Customer Orders].Refresh
End Sub