Can form and subform data properties be different?

  • Thread starter Thread starter Chris v.
  • Start date Start date
C

Chris v.

In Access 2007, I have a form ("Groups" - think classes) and subform
("Attendance") and want to different data settings on them. The main form
(Groups) serves as a lookup form and I don't want the data entry clerk to be
able to edit the group names nor add groups. For the subform I would like to
have the retrieved attendance records locked (can't be changed) with new
records being able to be added. Is it possible to do this? It seems that the
subform "inherits" the properties from the main form.
 
Hi Chris,
You can lock the controls so the user can't edit them.
For the subform you can use code something like this to control edits.

If Me.NewRecord = True Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Jeanette, thanks for the reply. It looks straight forward enough, however
I've only been using macros and not written sql yet. Where would I place this
code?
 
Place the code on the current event of the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Thanks Jeanette - It worked like a charm.

Jeanette Cunningham said:
Place the code on the current event of the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top