After User Input have the cusor in the next field

Merry Christmas...

I am working on a form and there are a lot of user inputs.  But everything I enter new data into a field the cusor goes back to the front of the record.  After each input I have it saving the record.....

Any help???
Jass SainiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ScotterMonkieCommented:
Hi. Can you show your code, please?
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Merry Christmas!

I guess I first have to ask; why are you saving after every input?  That's a lot of extra overhead.

As for the behavior, that's what it is; when a record becomes current, move to the first field in the tab order.

So what you'll need to do if you want to continue saving is keep track of the current control, and then in theOnCurrent event, SetFocus to that control yourself.

Jim.
0
Dale FyeCommented:
Why are you saving the record after each input, you do mean every field, right?

Have you checked the TabStop property of each of the controls on your form?  For those you want the user to enter data into, the value should be set to Yes.  You can also modify the tab sequence, in 2007, you open the form in design view, then click on the "Arrange" tab in the ribbon and then select "Tab Order" from the Control Layout section of the ribbon.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Jass SainiAuthor Commented:
I only have code to save the record...But after I do the input, the cusor ends up in the first field of the record and I want it to go to the next field.

Private Sub BC1Chng1_AfterUpdate()
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.Requery
End Sub

Open in new window

0
Dale FyeCommented:
Although there are valid reasons for saving the record when a particular controls value is changed, this is not the norm.  Normally, you would not save the record until all of the required fields have had data entered.  If you have controls which are based on another control, like cascading combo boxes, then you don't need to save the entire record, to force the 2nd or 3rd combo to requery, you simply requery those controls.

Then use the Form_BeforeUpdate event to check whether all of the required fields have values, and if not, then cancel the Update.
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    Me.Requery
>>

 The question for you is why?  There's no reason to normally.    usually, you let a user enter all the fields, validate the data, then save the record.

Jim.
0
Jass SainiAuthor Commented:
Dale,

I think everytime I do the input into the fields I have it saving the record and I do have the TabOrder correct.  But I think when it saves, it goes back to the front of the record
0
Jass SainiAuthor Commented:
So how do I save the record at the end when the user is done with the inputs...also I have a total in the footer that I need to update based off the field..So I guess that was why I was saving after each input
0
Jass SainiAuthor Commented:
Yep that was it...I need the field to update so it populates the total in the footer.  If I save the form then it was updating the "total" in the footer and this was the only I knew how to save the input and populate the footer field..

Saving each field does have the DB lagging.
0
Helen FeddemaCommented:
That is very old (ca. Access 95) syntax.  Here is the current syntax for saving a record:

DoCmd.RunCommand acCmdSaveRecord
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<< But I think when it saves, it goes back to the front of the record >>

  Not only on a save, but the requery causes that as well.   Anytime a new record becomes current, you will move back to the start of the tab order.

<<So how do I save the record at the end when the user is done with the inputs...>>

 Normally, you let the user save, either by clicking a "save" button, short cut key, moving to a new record, etc.

 If you wanted to force a save for some reason, then you could do that in the afterupdate of a control, or use the forms timer to detect if someone has sat too long without saving the record "You haven't saved the record yet, do you wish to save?"

 But normally, you let user action initiate the save.  It's not something you do.

<<also I have a total in the footer that I need to update based off the field..So I guess that was why I was saving after each input >>   

 It will update on it's own.   If you want to force it sooner, then do:

Me.<control name>.Requery

Jim.
0
Jass SainiAuthor Commented:
Hello Jim,

<<also I have a total in the footer that I need to update based off the field..So I guess that was why I was saving after each input >>   

So I

Me.<control name>.Requery    and when I tab over it doesn't update the footer totals.  It only updates when I click in another box with the mouse.  I want to be able to tab over and have it update the footer total as I tab!!!

Thank for helping. I got rid of the save record and I will add a button to have the user save.
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Maybe if you posted a screen shot of your form and what it is your doing, that would help.  Not sure quite sure what your doing, but having to save a record after every control update is not the norm.

Jim.
0
Jass SainiAuthor Commented:
It's the Final_frm...

Also there is alot of coding that don't prefer to this form.  Just want to know how to do the input ..BC1-BC4..and for it to populate the totals in the footer
Database10.accdb
0
PatHartmanCommented:
I don't mean to equivocate but --- NEVER use Me.Requery or Me.Refresh to save a record.  Those methods have specific uses and saving a record is not one of them.  Saving a record is a side-effect of those methods but as you have discovered, when you don't use the correct SAVE instruction you end up with undesirable side effects since the method is doing what it is intended to do and oh, by the way, it is saving the record.  Helen gave you the correct method for saving a record.

Your problem is a concept one.  The subtotals should not update until the record is saved and the record should not be saved until it is complete.  That is the "Access" way.  The problem with using a RAD tool is that if you want to deviate from the normal method of operation, you have to do a lot of extra work and you still may not get the results you desire.  Your current approach means that you are saving incomplete data since after any field entry, the user could close the form and move on.  This will probably lead to other undesired effects when you get to reporting.
0
Jass SainiAuthor Commented:
You have a point...I  am learning on my own and I am still new at this.  The last guy did his database like that...I just want to be able to populate the totals as I input data in my fields.
0
PatHartmanCommented:
As long as you don't care if the record is missing data, save whenever you want.  You know what is correct for your app.  Just use the correct save method to avoid the undesirable side effects.  If having empty fields is not acceptable in the finished product then you'll need to make some modifications to other areas of the app.  Add a complete indicator to the table.  In the BeforeUpdate event of the FORM, analyze all the field contents.  If everything is present and valid, set CompleteInd = True, otherwise set it to False.  In your queries,  only select records where CompleteInd = True.  You will also need to add a query/form that runs when the app opens that looks for incomplete records and nag the user to either complete them or delete them.  All in all, a lot of work to populate totals mid form update.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jass SainiAuthor Commented:
Thanks
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Sorry I'm just getting back to this.

As Pat said, your problem is a conceptual one.  When your adding a new record, it's really not considered part of the totals until it's saved, and prior to that, everything should be valid.

However if you really want to show it as part of the total, then what you can do is get the sum() of existing records, and add the value of the current record.   Might even do it like:

 Existing Records:  <total>   Current Record: <total>   Total Value: Existing Records + Current Record.

The only issue with that is you need to be aware if your adding a new record, or updating an existing one.   If updating an existing record, then the current record is already in the existing records total.

Does that make sense?  If so, let us know what you want to do (don't bother updating the total for the current record, show existing and current as one total, or broken down like I showed above) and we will tell you how to do that.

Jim.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.