Unable to enter New Records without allowing Edits

C

cbgraham_asu

My problem is adding new records to a form.
Have a main form with two subforms. The first subform is a continuous
form that shows past due items that require status. The second subform
is for users to provide status to those items weekly until they are
completed. The subforms are synchronized through master and child
fields in the main form. This part works great. User picks a record to
status from subform 1, all of their previous comments popup below in
subform 2.

They should be able to add new comments to subform2 (allow additions)
but I have "allow deletions" and "allow edits" set no. The problem is
when they are adding a new record, it saves right in the middle of
their typing, so then they can't edit anymore or even finish their
sentence. I have no idea why it does this! There are several other
forms setup the same way within this datbase (to status other types of
items) and they all work fine accept for this one. I can't find any
differnce in how they are set up. Any idea what is causing the
record to save/lock them out at such uncontrollable intervals????
 
R

Rick Brandt

My problem is adding new records to a form.
Have a main form with two subforms. The first subform is a continuous
form that shows past due items that require status. The second subform
is for users to provide status to those items weekly until they are
completed. The subforms are synchronized through master and child
fields in the main form. This part works great. User picks a record to
status from subform 1, all of their previous comments popup below in
subform 2.

They should be able to add new comments to subform2 (allow additions)
but I have "allow deletions" and "allow edits" set no. The problem is
when they are adding a new record, it saves right in the middle of
their typing, so then they can't edit anymore or even finish their
sentence. I have no idea why it does this! There are several other
forms setup the same way within this datbase (to status other types of
items) and they all work fine accept for this one. I can't find any
differnce in how they are set up. Any idea what is causing the
record to save/lock them out at such uncontrollable intervals????

If the Tab Cycle property is set to All Records and your Tab Order is not
correct then it might try to change records half way through entering the
record. Otherwise you would have to have a code or macro that is causing the
save.
 
A

aaron.kempf

just put allowedits= true.. OK?

if you want; you can put some more advanced logic in there.. like
beforeupdate event you can check to see if the record is less than 10
minutes old; if it's newer then allow updates; otherwise don't allow
updates

-Aaron
 
C

cbgraham_asu

Rick,
I'm not sure what you mean by " correct Tab order," there are only
two fields in the subform record, Comment Date & Comment. Comment date
saves the current date when a new comment is entered is locked.
Comment date is first in the tab order. I changed the Cycle to
"current record" . Still though, if you hit the space bar or otherwise
pause while you're typing, the records saves. (doh) There aren't any
events with code on this subform or the main form. There is very little
vba code in the database, as I'm pretty much a novice to Access.
Not sure if it matters but the first subform with the aged items built
from a query which is based on a linked excel table (this data is
updated by an external system daily). The comments are stored in a
table on the backend of the Access database.
 
C

cbgraham_asu

just put allowedits= true.. OK?

if you want; you can put some more advanced logic in there.. like
beforeupdate event you can check to see if the record is less than 10
minutes old; if it's newer then allow updates; otherwise don't allow
updates

-Aaron

I would really rather not allow edits (people would edit things!).
Since this has to show a historical record of the efforts people take
to resolve their backlog. I like the less than 10 minutes old idea
though. However, I'm afraid the logic you refer to requires more
access skill than I have, unless you know of an example I can pull from.
 
R

Rick Brandt

Rick,
I'm not sure what you mean by " correct Tab order," there are only
two fields in the subform record, Comment Date & Comment. Comment date
saves the current date when a new comment is entered is locked.
Comment date is first in the tab order. I changed the Cycle to
"current record" . Still though, if you hit the space bar or otherwise
pause while you're typing, the records saves. (doh) There aren't any
events with code on this subform or the main form. There is very little
vba code in the database, as I'm pretty much a novice to Access.
Not sure if it matters but the first subform with the aged items built
from a query which is based on a linked excel table (this data is
updated by an external system daily). The comments are stored in a
table on the backend of the Access database.

I can think of no reason for pausing or pressing the space bar to trigger a
save. Do you have any Timer events running in the parent form or any other open
forms?
 
A

aaron.kempf

yeah.. if this were an 'Access Data Project' I could write a simple
trigger for you :)



I used to live in a city called Graham.. so maybe I'll give this a shot

a) open the form in design view
b) select the form properties (it is in between the horizontal ruler
and the vertical ruler
c) on the events tab; find beforeupdate and then hit the elipsis (build
button aka ... )
d) put this code
e) make sure that you have a column called 'DateEntered' in the
table.. set the datatype = 'Date/Time'; and the default for that column
to '=Now()'
f) this code should look something like this:

Public Sub Form_BeforeUpdate(cancel as integer)
If Abs(DateDiff("M", Now(), Me.DateEntered)) > 10 then cancel = true
End Sub

let us know if it's giving you a hard time; I hope i've helped.
I like helping people.. it's just hard sometimes because my mind moves
100 mph and my fingers only type about 50 wpm lol

-Aaron
 
C

cbgraham_asu

I can think of no reason for pausing or pressing the space bar to trigger a
save. Do you have any Timer events running in the parent form or any other open
forms?

Nope, no timer events anywhere, It's so wierd. I can't think of
anything that might be causing it. It's a shared database, so the
locking is pretty optimistic. For the record subform I have locking at
edited record though. (not sure if that matters). Also, if I just open
the subform a part from the mainform, it works fine. The only thing I
can think is that maybe some how since the forms are synchronized off
of the mainform something is forcing it to refresh at intervals? I
don't know what that would be or why though.
 
R

Rick Brandt

Nope, no timer events anywhere, It's so wierd. I can't think of
anything that might be causing it. It's a shared database, so the
locking is pretty optimistic. For the record subform I have locking at
edited record though. (not sure if that matters). Also, if I just open
the subform a part from the mainform, it works fine. The only thing I
can think is that maybe some how since the forms are synchronized off
of the mainform something is forcing it to refresh at intervals? I
don't know what that would be or why though.

Try putting a MsgBox in the BeforeUpdate event so you can see exactly when the
save attempt is occurring. You could even put a Cancel=True based on the
response to the MsgBox. That might yield some additional information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top