Can form and subform data properties be different?

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.
 
J

Jeanette Cunningham

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
 
C

Chris v.

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?
 
J

Jeanette Cunningham

Place the code on the current event of the form.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
C

Chris v.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top