recording a record

T

Tom

I want to create a button or whatever
on my form so when folks are done
entering the required information
they can click on the button and it
will automatically move to a
new record for entry. I thought
I read it in the "help" section but
now my brain is shot and I can't find it.

Tom
 
R

rico

Create a button, then in the OnClick event (properties>events) of the button,
type the following:

DoCmd.GoToRecord , , acNewRec

HTH

Rico
 
K

Klatuu

If you just leave the navigation buttons on the form, they will handle that
quite well and yo don't have to do anything. We lazy types love the part
where we don't have to do anything.
 
K

Klatuu

Yes, for both rico's solution and mine. In a bound form, if you move from
the current record, it is saved before moving.
 
K

Klatuu

Doesn't make sense, post back with exactly what you are doing, and any code
you are using.
 
T

Tom

I placed a "command button" on my form.
I right cliked on the button and brought up
properties.
I chose the "event" tab.
I typed into the space next to "On Click"

DoCmd.GoToRecord , , acNewRec

then closed the properties dialog box
saved then
I changed view to "Form View"

I entered information into the record then clicked on the "command button"
This is what I got.

Microsoft Access can't find the macro "DoCmd."
"The macro (or it's macro group) doesn't exist, or the macro is new and
hasn't been saved. Note that when you enter the macrogroupname.macroname
syntax in an argument, you must specify the name the macro's macro group was
last saved under."

I appreciate the help
Tom
 
K

Klatuu

Excellent discription, Tom, thanks!
The problem is the way you entered it, Access thinks it is a macro. When
you click in the box next to On Click, you need to click the button to the
right with the dots in it([...]). You will get a dialog box that says
Expression Builder, Macro Builder, Code Builder.
Click on Code Builder. The VB Editor will open with the sub already
defined. Put your code in there, Save it, and try it again.
 
T

Tom

GOT IT!!
Thanks for all you help!
Tom

Klatuu said:
Excellent discription, Tom, thanks!
The problem is the way you entered it, Access thinks it is a macro. When
you click in the box next to On Click, you need to click the button to the
right with the dots in it([...]). You will get a dialog box that says
Expression Builder, Macro Builder, Code Builder.
Click on Code Builder. The VB Editor will open with the sub already
defined. Put your code in there, Save it, and try it again.

Tom said:
I placed a "command button" on my form.
I right cliked on the button and brought up
properties.
I chose the "event" tab.
I typed into the space next to "On Click"

DoCmd.GoToRecord , , acNewRec

then closed the properties dialog box
saved then
I changed view to "Form View"

I entered information into the record then clicked on the "command button"
This is what I got.

Microsoft Access can't find the macro "DoCmd."
"The macro (or it's macro group) doesn't exist, or the macro is new and
hasn't been saved. Note that when you enter the macrogroupname.macroname
syntax in an argument, you must specify the name the macro's macro group was
last saved under."

I appreciate the help
Tom
 
Top