G
Guest
Hello,
The first part of this works fine:
I have a large table of data to display, so I break it into subform views.
On the Master form M1 I display the name address, phone and stage#. On
subform S1 I display stages1-9 which is simply a lot of dates and a
lastEditedBy# field for each stage. Stages 10-19 is the same as stages1-9
except the numbers change.
I use VBA code on each date field's afterUpdate event to update each stages
lastEditedBy# field. If I change stage4's date, VBA automatically changes
stage4_afterupdate()
lastEditedBy4.value = currentuser()
exit sub
This is were it stopped working:
Since there are so many stages (49 total) I wanted to update the master form
M1 to include lastStage. Every time I edit the stages date, I added to my VBA
stage4_afterupdate()
lastEditedBy4.value = currentuser()
FORMS!M1.controls!lastStage.value = 4 ' *** new line -- error
happens here
exit sub
Now, after adding the new line when I click to another sub form or try to
select another record I receive the error
the data has been changed
Now, this next thing sort of fixes the problem, but I will get strange
effects, such as when I click on the TAB control for another subform, I will
now have to click twice instead of once before the control becomes active,
but I do NOT get the error "the data has been changed"
stage4_afterupdate()
me.requery
forms!m1.requery
lastEditedBy4.value = currentuser()
FORMS!M1.controls!lastStage.value = 4 ' **** error goes away
exit sub
Each form & subform uses a query as the data source. The query does not
duplicate any date except a master key. The master key is used to link the
form & subforms using (parent & child links)
thanks for your help,
phil
The first part of this works fine:
I have a large table of data to display, so I break it into subform views.
On the Master form M1 I display the name address, phone and stage#. On
subform S1 I display stages1-9 which is simply a lot of dates and a
lastEditedBy# field for each stage. Stages 10-19 is the same as stages1-9
except the numbers change.
I use VBA code on each date field's afterUpdate event to update each stages
lastEditedBy# field. If I change stage4's date, VBA automatically changes
stage4_afterupdate()
lastEditedBy4.value = currentuser()
exit sub
This is were it stopped working:
Since there are so many stages (49 total) I wanted to update the master form
M1 to include lastStage. Every time I edit the stages date, I added to my VBA
stage4_afterupdate()
lastEditedBy4.value = currentuser()
FORMS!M1.controls!lastStage.value = 4 ' *** new line -- error
happens here
exit sub
Now, after adding the new line when I click to another sub form or try to
select another record I receive the error
the data has been changed
Now, this next thing sort of fixes the problem, but I will get strange
effects, such as when I click on the TAB control for another subform, I will
now have to click twice instead of once before the control becomes active,
but I do NOT get the error "the data has been changed"
stage4_afterupdate()
me.requery
forms!m1.requery
lastEditedBy4.value = currentuser()
FORMS!M1.controls!lastStage.value = 4 ' **** error goes away
exit sub
Each form & subform uses a query as the data source. The query does not
duplicate any date except a master key. The master key is used to link the
form & subforms using (parent & child links)
thanks for your help,
phil