Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Noob question - open form for data entry

Status
Not open for further replies.

hpl2001

Programmer
Dec 18, 2001
105
CA
Hello:

I have a bound form, and I'd like to open it at a new record for data entry. Currently in the form load event I am calling a macro the that uses the action GoToRecord, with the record set to New. When I open my form I get the following error message:

You can't go to the specified record
You may be at the end of a recordset


It seems to me that this operation must be a requirement of most access appilcations. How is it done?
 
Have you considered setting the form's data entry property to true?
 
How are ya hpl2001 . . .

Forget the macro. In the forms [blue]On Load[/blue] event, simply try:
Code:
[blue]   DoCmd.RunCommand acCmdRecordsGoToNew[/blue]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks for the advice so far...still no luck, though. My form's data entry is set to Yes.

I have tried the DoCommand, and this is the error message I get:

The command or action 'RecordsGoToNew' isn't available now.

I pretty sure my data connection is good because my form is loading populated and I can move through the existing records. Any thoughts?

Thanks...Holly
 
Descending from most likely to least likely I expect your issue to be...

Did you select event procedure on the ON Load event and put the line of code in the procedure when you click the build button (three little dots)?

Did you Compile all your modules to verify there are no synatx issues?

Did you check for missing references?
 
I see one other odd thing. On my form I can arrow back and forth between my records, but the button to go to a new record is greyed out. So I wonder if I've missed something about how my data is connected to the form.
 
Is your Recordsource updateable? Can you open it and edit it? If not that is your problem.

I'd have to know more about the query and what you are trying to accomplish to know how to fix it.
 
I figured it out - a problem in my query. Thanks everyone for the assisstance.
 
hpl2001 said:
[blue]17 Jun 11 9:42: My form's data entry is set to Yes.[/blue]
With data entry set to yes the form automatically goes to a new record on open. This also explains the error in your post origination. [blue]You shouldn't need the action GoToRecord![/blue]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see faq219-2884 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top