D
Damien McBain
In my Database (which I have posted details of in the post entitled
"Dcount?" below) to refresh the memory:
Like this:
Territories Customers Sales ProductHierarchy
----------- --------- ----- ----------------
AccNo 1--> AccNo
CustName PH2 <----1 PH2
Class ActTonnes Description
Terr 1-----> Terr ActSale
Description Status etc etc
SOff
I have a form based on the "Customers" table with a subform based on the
Sales table, linked by the field AccNo.
The subform displays continuous forms for each PH2 field.
I have some calculated TextBox's on the subform, for example ActSalePT has a
recordsource(=Iif(ActTonnes<>0,ActSale/ActTonnes,0).
On the calculated TexBox (which is locked) I have an OnDoubleClick event
which causes the ActSalePT to become invisible and another unbound text box
underneath it to become visible. The unbound text box has an AfterUpdate
event which changes the value of ActSale based on the new value typed into
the unbound text box:
Private Sub AdjTR_AfterUpdate()
[BudSale] = [AdjTR] * [BudTonnes]
[Text26].Visible = True
[BudSale].SetFocus
[AdjTR].Visible = False
End Sub
The problem is that when I double click the ActSalePT text box and it
disappears and the unbound text box appears, it appears on all the
continuous forms in the subform. If the users don't use the right record
(form in the subform) all hell breaks loose.
Is there a better way to do this such that only the data in the active form
in the subform can be edited in this way?
Damien
"Dcount?" below) to refresh the memory:
Like this:
Territories Customers Sales ProductHierarchy
----------- --------- ----- ----------------
AccNo 1--> AccNo
CustName PH2 <----1 PH2
Class ActTonnes Description
Terr 1-----> Terr ActSale
Description Status etc etc
SOff
I have a form based on the "Customers" table with a subform based on the
Sales table, linked by the field AccNo.
The subform displays continuous forms for each PH2 field.
I have some calculated TextBox's on the subform, for example ActSalePT has a
recordsource(=Iif(ActTonnes<>0,ActSale/ActTonnes,0).
On the calculated TexBox (which is locked) I have an OnDoubleClick event
which causes the ActSalePT to become invisible and another unbound text box
underneath it to become visible. The unbound text box has an AfterUpdate
event which changes the value of ActSale based on the new value typed into
the unbound text box:
Private Sub AdjTR_AfterUpdate()
[BudSale] = [AdjTR] * [BudTonnes]
[Text26].Visible = True
[BudSale].SetFocus
[AdjTR].Visible = False
End Sub
The problem is that when I double click the ActSalePT text box and it
disappears and the unbound text box appears, it appears on all the
continuous forms in the subform. If the users don't use the right record
(form in the subform) all hell breaks loose.
Is there a better way to do this such that only the data in the active form
in the subform can be edited in this way?
Damien