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
How do I encrypt a string so that it is suitable to be a filename?
sql query
Insert File VBA issues with Styles
DataGrid Datasource is nothing after postback. Can't get at the data.
ClickOnce Update to disk path
hide a txt file
recordset - find and criteria
how to configure my SMTP server for outgoing verizon
VBA error disables page layout
SQL Query to get row total?