New Record, Cursor Jumps to Beginning of Field

  • Thread starter DenBis via AccessMonster.com
  • Start date
D

DenBis via AccessMonster.com

Hi all,

I am experiencing the following problem ONLY whenever I enter a new record on
a form, be it using an "Add Record" type button, or using the record selector.
Regardless of which field I decide to input data into, as soon as I type one
or two characters, the cursor jumps back to the beginning of that field, and
I have to re-type what I typed the first time.
None of the fields have events associated with them; and the OnCurrent event
of the form does not have anything that could cause the problem (I took the
commands out of the picture).

The only thing I have happening is that I have Conditional Formatting on each
field: whenever the field has the focus, the background color becomed blue.
However, my problem still exists even with the Conditional Formating removed.

Any ideas/solutions would be greatly appreciated.

Denis
 
D

DenBis via AccessMonster.com

Hi Allen,

Thanks for your reply. Unfortunately, I do not have any timer events either.

For troubleshooting purposes, I set the "Record Selector",to yes and clicked
on a command button which creates a new record then sets focus to a specific
field [ProjNumber]. The behavior I am seeing is that after I enter any type
of character, the record is (somehow) saved (this is evident as the 'edit
pencil(?) in the Record Selector changes to indicate the record is saved),
and the cursor goes back to the beginning of the field being inputted. Again,
I can 'Add a New Record', click into any other field and the same behavior
can be observed.

Cheers!
Denis
 
A

Allen Browne

Is this form based on a query that uses more than one table? If so, there is
an odd behavior when one of the fields in the lookup table (not the one you
are actually trying to add do) has a Default Value set in the field of the
table or the controls of the form.

If that is not the issue either, try creating a new form with no code, and
no input masks, and see if it still does this.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

DenBis via AccessMonster.com said:
Hi Allen,

Thanks for your reply. Unfortunately, I do not have any timer events
either.

For troubleshooting purposes, I set the "Record Selector",to yes and
clicked
on a command button which creates a new record then sets focus to a
specific
field [ProjNumber]. The behavior I am seeing is that after I enter any
type
of character, the record is (somehow) saved (this is evident as the 'edit
pencil(?) in the Record Selector changes to indicate the record is saved),
and the cursor goes back to the beginning of the field being inputted.
Again,
I can 'Add a New Record', click into any other field and the same behavior
can be observed.

Cheers!
Denis

Allen said:
Long shot, Denis, but is there *any* form that has a timer event running?
 
D

DenBis via AccessMonster.com

Allen,

The form "frmProject" (and specifically the fields affected) is based on a
table, and I also have sfrm1 ('many' side of frmProject) and sfrm2 (is on the
'many' side of sfrm1).
I will review all the fields and controls for any anomilies.
THanks again,
Denis
 
A

Allen Browne

I'm not clear here.

Which form has the problem? The main form, or one of the subforms?

Are the subforms also bound to the same table as the main form, or related
tables?
 
D

DenBis via AccessMonster.com

Sorry Allen,

The problem is with the main form (frmProject). The subforms are bound to
related tables.

Tables: tblProject (1->many) - tblRequirements (1->many) - tblCandidates
Forms: frmProject -->sfrmRequirements --> sfrmCandidates

Denis
 
A

Allen Browne

Okay, time to break the problem down into smaller chunks to identify the
culprit.

1. Create the main form without the subforms, leaving out the conditional
formatting.

2. If that works, add the first suform.

3. If that works, add the 2nd subform.

If it fails at some point, we are at least narrowing it down, and getting
closer to idenfitying the issue.

Step 1 should work: a form bound directly to a table, without any code. If
that still fails the problem is with something else in the database, or the
database is corrupt.
 
D

Dirk Goldgar

DenBis via AccessMonster.com said:
Hi all,

I am experiencing the following problem ONLY whenever I enter a new
record on a form, be it using an "Add Record" type button, or using
the record selector. Regardless of which field I decide to input data
into, as soon as I type one or two characters, the cursor jumps back
to the beginning of that field, and I have to re-type what I typed
the first time.
None of the fields have events associated with them; and the
OnCurrent event of the form does not have anything that could cause
the problem (I took the commands out of the picture).

The only thing I have happening is that I have Conditional Formatting
on each field: whenever the field has the focus, the background color
becomed blue. However, my problem still exists even with the
Conditional Formating removed.

Any ideas/solutions would be greatly appreciated.

Denis

Do you have any code in the form's Dirty event or BeforeInsert event?
 
D

DenBis via AccessMonster.com

Allen,


Thanks for your assistance and your patience.

Forms: frmProject -->sfrmRequirements --> sfrmCandidates

Using your methodology, I was able to isolate the culprit as the DoCmd code
in the [Requirement] field (a combo box) of sfrmRequirements (the 1st subform)
:

Private Sub Requirement_Exit(Cancel As Integer)
DoCmd.RunCommand acCmdSaveRecord
lstRequirements.Requery
End Sub

By eliminating that line, all works perfectly. I even removed the OnExit
event and recreated it before eliminating the code and it still failed. I do
not understand why it happened, as I do not have any code in frmProject that
refers to, or invokes any controls on sfrmRequirements.

Cheers!

Denis
 
D

DenBis via AccessMonster.com

Hi Dick,
I do not.
Refer to my latest post to Allen for the problem.
Thanks for your reply.

Denis
 
A

Allen Browne

Well done. Pinpointed and removed.

Presumably Requirement refers to the control on the main form that links to
your sfrmRequirements subform. I am not clear why you wanted to save the
record here, doing so should not trigger the cursor jump you originally
alluded to, so there are still other factors here (such as the RowSource of
lstRequirements.)

Anyway, you've solved the issue. Interacting events can have strange
effects.
 

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