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
RIS Image problems
Windows Media Player
Use xml parameter in SQL Server select
Copy data from multiple workbooks with VBA
Regex.Replace only match entire word instead of part of a word
MS Access Extended list - selections from saved list
Reference Data In XML Document
Help installing Server 2003 on RAID
How to extract table field list using query
Check POP3 Mailbox From VB.NET