Microsoft
Software
Hardware
Network
Question : Access database - Problem with gorecord acnewrec
Hi,
I have a split form wherein I have buttons like Add, Delete, Save
In the Form properties, I said - AllowAdditions - No and the datasheet is made as non-editable
It retrives the records correctly. And I don't see any new record added by default.
Now, I click on Add button to add a new record.
Add button code:
-----------------------
me.allowadditions = true
docmd.gorecord , , acNewRec
It throws error in the line docmd.GoToRecord, , acNewRec
Below is the error: Runtime error 2105. You can't go to the specified record..
I feel sometimes it works. Sometimes it does not work.
One more flow is: If I delete one record using docmd.runcommand accmdDeleterecord, then Adding a new record always fails...
Delete button click event:
--------------------------
-------
docmd.Setwarnings false
docmd.runcommand accmdDeleteRecord
docmd.Setwarnings true
docmd.gotorecord, , aclast
Delete button code works fine. But after this if I click on Add button, again I get the same error 2105...
Answer : Access database - Problem with gorecord acnewrec
"datasheet is made as non-editable "
Since the form does not allow edits, you won't be able to go to a new record.
How about
me.allowadditions = true
Me.AllowEdits = True ' **** turn this on here
docmd.GoToRecord, , acNewRec
Random Solutions
Excel 2007 Autosave
Create Date Table
Autonumber in Query
Windows Task Manager and CPU Usage Windows
Exchange 2003 database is constantly over the limit
Insert field into memo field
Excel Macro to check all data in Colum A in sheet1 and delete all cells that contain that in all sheets
Group sum calculated fields (which contain aggregate function) by group
Resource unavailable when calling modeless dialog from regular MFC dll
Show days excluding weekends