Form/SubForm Auto Record Save

  • Thread starter Thread starter DonaldRegener
  • Start date Start date
D

DonaldRegener

I have a Form with an "Embedded" SubForm.

I use the "Form AfterUpdate" Event to Trigger three
different reports. The Reports take date from the Current
Record on the Open Form. (EveryThing works as desired.)

When I go to the Embedded SubForm (On the Main Form), the
record appears to have an "AutoSave" before allowing Input
to the SubForm. This "AutoSave" then triggers the Main
Form "BeforeUpdate" and "AfterUpdate" event (As part of
its save) and Incorrectly Triggers the "Send Report"
Function WITHOUT all of the Desired Flags. I DO NOT WANT
TO SEND THE REPORTS AT THIS TIME.

I assume there is no way for me to actually Turn Off
this "Record AutoSave" before going to the SubForm. Can
you think of some other Form Event I can move the "Report
Triggers" and assorted logic to?

Thanks in Advance for your Assistance.

Don
 
Donald,

I can't think if there is a way to avoid the Main record getting updated
when you enter data into the subform. I would suggest that if you don't
want to use a button to open the reports, then put code in the after update
events of the flags you are using which will check all the pertinant
controls for data and then print the reports then they are all populated.

God Bless,

Mark A.Sam
 
Sam:

First I would like to thank you for your assistance.

I could not think of any way to stop the Main Record
Update BEFORE putting data in the SubForm either. This is
why I started look at a place to "Move" my Email Triggers
from the Form AfterUpdate Event to some other place. I
have tried a separate Command button and Form Dirty.
Neither one work.

My first thought was two sets of flags. I use a Case
Select statement and issue flags upon opening the form and
again upon update of the three "Trigger Events". I cannot
think of a way to set a Flag for "SubForm" entry. All of
these events seem to be transparent and happen well before
any actual activity in the SubForm. IF ONLY I could put a
Flag when I "Touch" the SubForm, that would solve my
problem.

Thanks Again,

Don
 
Don,

You could disable the subform until all of the necessary data is entered on
the main form. This again would be checking the contents after updating
each control. You wouldn't need to knwo the name of each control, simply
tag each one and iterate through the controls testing the tagged ones.

Someting like this...


Dim ctl as Control

For Each ctl in Me.Controls
If ctl.Tag = "some text"
If IsNull(ctl) or ctl = "" Then
Exit Sub
End If
End If
Next ctl

[mySubform].Enabled = True

That is untested but should do the job. Boolean controls would be tested for
True or False or 0 and <>0 if SQL Servers tables are used.

It tests the value of each tagged control and if the test fails the
procedure ends. If it doesn't fail, the Subform is enabled.

God Bless,

Mark
 
Mark:

I reviewed this item at our local Access User's Group last
night. I have another lead to consider too ... Save the
Variables I am looking for so badly as Global Variables.
Move the 2 Original Triggers to the "Form Close Event".
This will remove my Triggers from the "After Update" event
that is causing the problem when the Record is saved
before entering the SubForm.

Really appreciate your help.

Don
-----Original Message-----
Don,

You could disable the subform until all of the necessary data is entered on
the main form. This again would be checking the contents after updating
each control. You wouldn't need to knwo the name of each control, simply
tag each one and iterate through the controls testing the tagged ones.

Someting like this...


Dim ctl as Control

For Each ctl in Me.Controls
If ctl.Tag = "some text"
If IsNull(ctl) or ctl = "" Then
Exit Sub
End If
End If
Next ctl

[mySubform].Enabled = True

That is untested but should do the job. Boolean controls would be tested for
True or False or 0 and <>0 if SQL Servers tables are used.

It tests the value of each tagged control and if the test fails the
procedure ends. If it doesn't fail, the Subform is enabled.

God Bless,

Mark






Sam:

First I would like to thank you for your assistance.

I could not think of any way to stop the Main Record
Update BEFORE putting data in the SubForm either. This is
why I started look at a place to "Move" my Email Triggers
from the Form AfterUpdate Event to some other place. I
have tried a separate Command button and Form Dirty.
Neither one work.

My first thought was two sets of flags. I use a Case
Select statement and issue flags upon opening the form and
again upon update of the three "Trigger Events". I cannot
think of a way to set a Flag for "SubForm" entry. All of
these events seem to be transparent and happen well before
any actual activity in the SubForm. IF ONLY I could put a
Flag when I "Touch" the SubForm, that would solve my
problem.

Thanks Again,

Don record
getting updated


.
 
Don,

That would work well if you only intend to enter a record then close the
main form. I didn't even consider that. ;)

God Bless,

Mark


Don said:
Mark:

I reviewed this item at our local Access User's Group last
night. I have another lead to consider too ... Save the
Variables I am looking for so badly as Global Variables.
Move the 2 Original Triggers to the "Form Close Event".
This will remove my Triggers from the "After Update" event
that is causing the problem when the Record is saved
before entering the SubForm.

Really appreciate your help.

Don
-----Original Message-----
Don,

You could disable the subform until all of the necessary data is entered on
the main form. This again would be checking the contents after updating
each control. You wouldn't need to knwo the name of each control, simply
tag each one and iterate through the controls testing the tagged ones.

Someting like this...


Dim ctl as Control

For Each ctl in Me.Controls
If ctl.Tag = "some text"
If IsNull(ctl) or ctl = "" Then
Exit Sub
End If
End If
Next ctl

[mySubform].Enabled = True

That is untested but should do the job. Boolean controls would be tested for
True or False or 0 and <>0 if SQL Servers tables are used.

It tests the value of each tagged control and if the test fails the
procedure ends. If it doesn't fail, the Subform is enabled.

God Bless,

Mark






Sam:

First I would like to thank you for your assistance.

I could not think of any way to stop the Main Record
Update BEFORE putting data in the SubForm either. This is
why I started look at a place to "Move" my Email Triggers
from the Form AfterUpdate Event to some other place. I
have tried a separate Command button and Form Dirty.
Neither one work.

My first thought was two sets of flags. I use a Case
Select statement and issue flags upon opening the form and
again upon update of the three "Trigger Events". I cannot
think of a way to set a Flag for "SubForm" entry. All of
these events seem to be transparent and happen well before
any actual activity in the SubForm. IF ONLY I could put a
Flag when I "Touch" the SubForm, that would solve my
problem.

Thanks Again,

Don
-----Original Message-----
Donald,

I can't think if there is a way to avoid the Main record
getting updated
when you enter data into the subform. I would suggest
that if you don't
want to use a button to open the reports, then put code
in the after update
events of the flags you are using which will check all
the pertinant
controls for data and then print the reports then they
are all populated.

God Bless,

Mark A.Sam


"(e-mail address removed)"
message I have a Form with an "Embedded" SubForm.

I use the "Form AfterUpdate" Event to Trigger three
different reports. The Reports take date from the
Current
Record on the Open Form. (EveryThing works as desired.)

When I go to the Embedded SubForm (On the Main Form),
the
record appears to have an "AutoSave" before allowing
Input
to the SubForm. This "AutoSave" then triggers the Main
Form "BeforeUpdate" and "AfterUpdate" event (As part of
its save) and Incorrectly Triggers the "Send Report"
Function WITHOUT all of the Desired Flags. I DO NOT
WANT
TO SEND THE REPORTS AT THIS TIME.

I assume there is no way for me to actually Turn Off
this "Record AutoSave" before going to the SubForm. Can
you think of some other Form Event I can move
the "Report
Triggers" and assorted logic to?

Thanks in Advance for your Assistance.

Don


.


.
 
Mark:

The Basic Requirements:

Send "Customised Automatic Email Messages" as distinct
portions of a Form are completed. Selected Milestones:
(1) Initial Assignment; (2) Intermediate Due Data
Assigned; & (3) Final Completion Date Assigned.

These Records would come from a "New Record" for the first
milestone. The 2nd & Subsequent would be selected from
already started Records in no particular order or even the
same person. This sort of makes them into "Single Record"
processing with the form "Closed" after its
Initialization/Update.


I have implemented a Satisfactory Solution as follows:

(1) Moved all of the "Flag Processing" from the "Form
AfterUpdate Event" to an External Module. (The Flags are
set from the main form and transferred as Global
Variables.)

(2) Call the "External Processing" from the Form Close
Event. This Call Statement includes the "Record Number"
(Global Variable) I am working with.

(3) The External Process Resets the Flags after completing
the processing.

This process allows the SubForm to Save the Basic Record
as many times as it wants without processing any flags
until I am ready.

This item is closed.

Many Thanks,

Don
-----Original Message-----
Don,

That would work well if you only intend to enter a record then close the
main form. I didn't even consider that. ;)

God Bless,

Mark


Mark:

I reviewed this item at our local Access User's Group last
night. I have another lead to consider too ... Save the
Variables I am looking for so badly as Global Variables.
Move the 2 Original Triggers to the "Form Close Event".
This will remove my Triggers from the "After Update" event
that is causing the problem when the Record is saved
before entering the SubForm.

Really appreciate your help.

Don
-----Original Message-----
Don,

You could disable the subform until all of the
necessary
data is entered on
the main form. This again would be checking the
contents
after updating
each control. You wouldn't need to knwo the name of
each
control, simply
tag each one and iterate through the controls testing
the
tagged ones.
Someting like this...


Dim ctl as Control

For Each ctl in Me.Controls
If ctl.Tag = "some text"
If IsNull(ctl) or ctl = "" Then
Exit Sub
End If
End If
Next ctl

[mySubform].Enabled = True

That is untested but should do the job. Boolean
controls
would be tested for
True or False or 0 and <>0 if SQL Servers tables are used.

It tests the value of each tagged control and if the
test
fails the
procedure ends. If it doesn't fail, the Subform is enabled.

God Bless,

Mark






Sam:

First I would like to thank you for your assistance.

I could not think of any way to stop the Main Record
Update BEFORE putting data in the SubForm either.
This
is
why I started look at a place to "Move" my Email Triggers
from the Form AfterUpdate Event to some other place. I
have tried a separate Command button and Form Dirty.
Neither one work.

My first thought was two sets of flags. I use a Case
Select statement and issue flags upon opening the
form
and
again upon update of the three "Trigger Events". I cannot
think of a way to set a Flag for "SubForm" entry.
All
of
these events seem to be transparent and happen well before
any actual activity in the SubForm. IF ONLY I could put a
Flag when I "Touch" the SubForm, that would solve my
problem.

Thanks Again,

Don
-----Original Message-----
Donald,

I can't think if there is a way to avoid the Main record
getting updated
when you enter data into the subform. I would suggest
that if you don't
want to use a button to open the reports, then put code
in the after update
events of the flags you are using which will check all
the pertinant
controls for data and then print the reports then they
are all populated.

God Bless,

Mark A.Sam


"(e-mail address removed)"
message [email protected]...
I have a Form with an "Embedded" SubForm.

I use the "Form AfterUpdate" Event to Trigger three
different reports. The Reports take date from the
Current
Record on the Open Form. (EveryThing works as desired.)

When I go to the Embedded SubForm (On the Main Form),
the
record appears to have an "AutoSave" before allowing
Input
to the SubForm. This "AutoSave" then triggers the Main
Form "BeforeUpdate" and "AfterUpdate" event (As
part
of
its save) and Incorrectly Triggers the "Send Report"
Function WITHOUT all of the Desired Flags. I DO NOT
WANT
TO SEND THE REPORTS AT THIS TIME.

I assume there is no way for me to actually Turn Off
this "Record AutoSave" before going to the
SubForm.
Can
you think of some other Form Event I can move
the "Report
Triggers" and assorted logic to?

Thanks in Advance for your Assistance.

Don


.



.


.
 
Back
Top