How to get rid of adding new record at the end of a subform?
Asked Answered
S

4

11

I use a subform to show the result of a query, but at the end of record there is a *(New) for adding new records. I don't want the user to be able to add new records through this subform. How can I get rid of this?

Saloma answered 9/4, 2012 at 15:57 Comment(5)
@HansUp That is the answer, yesno?Funambulist
Thanks! It works, but in my Access just named "Enabled" under Data tab. It disallow add new record, but the word *(New) still there.. Can't I totally remove it?Saloma
wait.. I find "Allow Additions".. thxSaloma
@HansUp How about you add the answer and we vote to move to Superuser?Funambulist
I found "Allow Edits" and set it NO can get rid of *(New). Thanks HansUP!Saloma
F
17

With the subform in Design View, open its property sheet. Then select the Data tab on the property sheet, find the property named "Allow Additions" and set it to No.

The "Allow Additions" property will not display if you open the design view of the parent form and click on the subform. The subform must be opened in Design View independent of the parent form.

Fragrant answered 9/4, 2012 at 16:28 Comment(0)
I
0

Had exactly the same problem.

My DB is to keep track of basketball box scores. Every new main form created a new blank subform to enter the quarter scores into. The problem was as I Entered through the fields once I hit enter on the last quarter score value a new record was created for the table that Quarter Scores was based on. I could not use Allow Additions = no. If I did not allow additions there was no quarter score input created when a new main form (for a new game) was created. I used the code below for a key down event of the Enter key to set the focus on another subform before a new quarter score record was created.The commented lines were to help trouble shoot when creating the code. Key code 13 is the Enter key. Hope this helps someone, took a while to get this right. Den

Private Sub HOT2_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode <> 13 Then Exit Sub
    'MsgBox "Enter Pressed"
    KeyCode = 0
    'MsgBox "KeyCode=0"
    Forms!FRM_BoxScores.Scrimmage.SetFocus
    Forms!FRM_BoxScores!subform_qryReturnVisitingPlayers_BosScores.Form!subform_tblPlayerPoints_BoxScores.Form!PlayerPoints.SetFocus

End Sub

Intermarry answered 29/6, 2018 at 23:16 Comment(0)
S
0

Change Record-set Type to Screenshot in Data Form Properties > Data Tab. Please note user cannot change any Data in form you once you change this

Scarabaeoid answered 18/1, 2019 at 22:32 Comment(0)
L
-1

in your subform design grid, open the properties.

Where is says recordset type, set it to snapshot. That will remove that line. The recordset will NOT be updateable at that time. So if you want to edit records, you have to change it back

Librate answered 18/10, 2016 at 10:34 Comment(1)
No. The question is not to make the form read-only, but to disallow additions. Which the accepted answer answers.Boccioni

© 2022 - 2024 — McMap. All rights reserved.