Error msg when adding record from form

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,772
When trying to add a record from a form I'm designing, I get the following error message:

Code:
You can't go to the specified record.
You may be at the end of the recordset

I've searched Access help and the message board but can't figure out what this means or how to solve it.
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
How are you trying to add the record?

Does the form have a query/table as a record source?

Can you add records to that query/table in datasheet view?
 
Upvote 0
I'm adding the record via a button I placed on the form using the wizard.

The form has a table as a record source

Yes, I can add records via datasheet view.

I've just realised that I have some fields which are required, which don't get populated by the form, which would obviously cause an error. Once I fix this, I'll report back if I still get the error.
 
Upvote 0
Do you mean you are using code to add the record?
 
Upvote 0
I added a button to the form, and then followed the wizard to enable the button to add the record. It has the following code:


Code:
Private Sub Button_Add_Record_Click()
On Error GoTo Err_Button_Add_Record_Click


    DoCmd.GoToRecord , , acNewRec

Exit_Button_Add_Record_Click:
    Exit Sub

Err_Button_Add_Record_Click:
    MsgBox Err.Description
    Resume Exit_Button_Add_Record_Click
    
End Sub
[/code]
 
Upvote 0
That isn't really adding a new record, it's going to a blank record.

But obviously if you were entering a record and pressed the button the current record would be added.

If that current record was missing data for a field that is required I would think it would cause problems.
 
Upvote 0
I've amended my form to include all the required fields but I still get the error message.

I don't understand what it means by "you may be at the end of a recordset".

Any ideas?
 
Upvote 0

Forum statistics

Threads
1,221,826
Messages
6,162,192
Members
451,752
Latest member
majbizzaki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top