Incrementing the data control with code

sorebrain

Registered User.
Local time
Today, 16:35
Joined
Oct 8, 2004
Messages
27
I have a form in which the subforms onExit event sets the focus to the autonumber CustomerID field in the main form but it stays on the current record. How can I get this to increment to the add new record with code?
Thanks,
sorebrain

Access 2000
learning as fast as I can :D
 
unsure if this is exactly want you need but you could use

Code:
    DoCmd.GoToRecord , , acNewRec
 
Worked for me!

That was quick and it worked perfectly. I am just learning and once I get some of the syntax sorted out I will be on my way. :)
 
the subforms onExit event sets the focus to the autonumber CustomerID field in the main form but it stays on the current record.

The form's behavior with respect to TAB treatment is set to cycle within the record rather than to step to the new record. This is in the Options dialog, I believe. Under either Editing or Forms/Reports behavior.

NOTE: Sometimes the behavior you described is correct! For cases where you require a separate action as part of the verification procedure 'cause you cannot tab your way off a page - you have to use a mouse function to do it. That way, you can only trash one record at a time.
 
Thats good to know

Doc_Man, I already found the setting in the Options so I knew that was there but I wasn't sure if I wanted it set that way for everything. I am just trying to learn some of the different ropes in respect to Access as I have only been working with it about a week :D I did some reading on Access a few years ago when I was going to learn it initially, but the training got shelved for lack of dedicated time. As far as the behaviour being correct sometimes, I can definitely believe that and I may end up setting it that way once we load up the customer info and get the bugs out :) Its for a customer service record database for my wife :eek: and when she enters the old records while loading it up, the default will be perfect. When in actual use, the jump to the main recordset will be better because only one record will ever get entered on any one given day and probably on the order of once a month...
 

Users who are viewing this thread

Back
Top Bottom