Go To New Record on Form Open

S

Steve

Hi,

I have a form for entering volunteer data. That form is accessed via a
command button on a 'Options' form with multiple buttons where a novice user
can enter new records, update certain fields, print a report, etc... What
I'd like to do is two-fold:

1 - I'd like the 'Enter New Volunteer' Button to take the user to a new
record. Do, if there are 250 records in the table when they select the
option, I want to automatically take them to a blank record 251 so they can
add the data.

2 - I'd like them to get the Options form when they start Access. Right now
they can select the Options Form from the forms tab but I'd like this to be
automatic; how would I do that so they start on my Options Form?

I have taught myself Access so I could help a volunteer coordinator for a
rather large event maintain and schedule about 1500 volunteers in 5 or 6
venues later this year. I just haven't been able to figure these two issues
out and have not found the answers in the online training.

Thanks in advance for all your assistance.

Steve
 
A

Arvin Meyer [MVP]

You can use either:

DoCmd.OpenForm "Formname",,,, acFormAdd

which will open the form in Add mode, or

DoCmd.OpenForm "Formname"
DoCmd.GoToRecord acNewRecord

to get all the records and then go to a new one.
 
L

Linq Adams via AccessMonster.com

As for having the form displayed when opening the database, goto Tools -
Startup and you'll see a dropdown box titled Display Form/Page. Click on the
arrow and select the Options form. Now, when you open the database, the form
will come up automatically.

Somewhere down the line, you'll realize that you need to do some work n the
db. From one of the forms you can hit <F11> and you'll be taken into the
inner workings.

You can also hold down the <Shift> key while clicking on the database to open
it, and you'll bypass the Options form and again be taken into the database.
 
S

Steve

Thank You - I modified the code to use the acFormAdd stmt and that worked.
When I tried using the second option (the Open and Goto), I couldn't get it
to work in Access2003.
 
L

Linq Adams via AccessMonster.com

I think the line

DoCmd.GoToRecord acNewRecord

would have to be in the Form_Load event of the form that is being opened in
order to work, not in the code of the form that's doing the calling.
 

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