I would like for users to only be able to add new records on a subform. If I set the DataEntry or Additions controls it doesn't change anything. I'm guessing because the main form is set differently. Is there a work around?
Bill,
Tried this and even double checked it with a print out of your email. Subform data is still editable. Any thoughts, anyone??? *************
M. MARNEY
The problem is though, I need the subform to DEFAULT to a new record and not show any of the other records. When a user selects the GroupID in the main form, it should pull up a new record in the subform, not showing any of the other records, tied to the main form by GroupID. Pressing buttons is not an option...
Thanks. *************
M. MARNEY
Hi mdmarney, if you'd like to zip up you DB and send it to me at billpower@cwcom.net, I'll try and find out what's going on, like I said, specifying DataEntry = True should suppress any existing records from being shown.
In the After Update event of you Combo Box Combo20 add the blue text, this will setfocus to your sub form:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Parish or Group ID] = " & Str(Nz(Me![Combo20], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark Me!frm_Add_Attendants_by_Group_Subform.SetFocus
In the On Current Event of your Form add the blue text, this will ensure your Sub Form will always be Data Entry and not display existing records:
Set rs = CurrentDb.OpenRecordset("Select * from tbl_Attendants"
rs.MoveLast
Me.tx_Count_Box = rs.RecordCount Me!frm_Add_Attendants_by_Group_Subform.Form.DataEntry = True
Thanks for e-mailing me your DB, it makes life so much easier being able to see the problem. Will delete it after sending this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.