Unable to go to new record

Will04

Registered User.
Local time
Today, 13:05
Joined
May 29, 2006
Messages
62
Hello everyone,

Can anyone help?

I have a data entry form via which I want to add records to a table. However, when I've entered data in the last field, the cursor remains there and the system just beeps. I added a command button on the form to go to a new record but when I click on the button i get the following message:-

You can't go to the specified record

You may be at the end of a recordset


Any suggestions??

Thanks

Will
 
Is your form bound to a table or a query? Do you have "Allow Additions" set to yes?
 
Verify that your data source [SQL] is valid.
 
Hi RG & GHudson,

Thanks for responding to my question.

The record source for the form is a single table and 'Allow Additions' is set to 'Yes'

Any other suggestions ?

Thanks again.

Will
 
I'm out of guesses. Any chance you can post your db for us to look at.
 
Here the Db

Hi RG,

I've stripped down the DB to only the table and the form. Hope you're able to help.

Thanks


Will
 

Attachments

Hi Will,
I'm afraid you will need to wait for someone better versed in macros. I don't use them and am unfamiliar with your particular problem.
 
Many thanks RG

I just can't seem to figure out why it's not working.. Dunno if its a marco prob. though..

Take care,


will
 
Will04 said:
Hello everyone,

Can anyone help?

I have a data entry form via which I want to add records to a table. However, when I've entered data in the last field, the cursor remains there and the system just beeps. I added a command button on the form to go to a new record but when I click on the button i get the following message:-

You can't go to the specified record

You may be at the end of a recordset


Any suggestions??

Thanks

Will

The reason that this is not working is that on your Add Record Event, you first of all call the macro New record and in the event procedure you have DoCmd.GoToRecord , , acNewRec

Remove the reference to the macro
 
The problem [at least one of them] is with the code in your Form_AfterUpdate. Remove it and you can save records. The field name in the table "fullname" is the same name as the control you are referencing. Access gets confused for it does not know which one you are using.

If you really want to do what you are attempting you should move it to the forms BeforeUpdate event.

Also, you need to add error trapping to all of your Subs() and Functions().

Code:
Private Sub Form_BeforeUpdate()
On Error GoTo Err_Form_BeforeUpdate

    fullname = Sname & ", " & Fname & " " & Mname

Exit_Form_BeforeUpdate:
    Exit Sub

Err_Form_BeforeUpdate:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Form_BeforeUpdate
 
Thanks so much guys,

It's working now. Much appreciated

Will
 

Users who are viewing this thread

Back
Top Bottom