Locking (disabling edit for) a row in continuous form

  • Thread starter Thread starter Jeff A via AccessMonster.com
  • Start date Start date
J

Jeff A via AccessMonster.com

Hi!

I'd like some help. I have a continuous form bound to a transaction table.
What I'd like to happen is that for certain rows/records, the user won't be
able to edit them if the Post field of that record is flagged as true.
However, the user should be able to add more records and/or change/delete
data of unposted records.

Thanks in advance!

Jeff
 
Try adding this line to the Current event procedure of the form:

Private Sub Form_Current()
Me.AllowEdits = Not Nz(me.Post, False)
End Sub

You might want to set the form's AllowDeletions as well.
 
Thanks Allen!

Just a related question: I'd like to change the backcolor of the controls of
the row if the Post field is flagged as true. I tried doing this with the
Current event but the rest of the rows change color as well depending on the
current row. Any suggestions on how to do this?
 
Use Conditional Formatting (Format menu in form design view):

Expression ... [Post] = False

Assumes A2000 or later.
 
It works! Thanks again

Allen said:
Use Conditional Formatting (Format menu in form design view):

Expression ... [Post] = False

Assumes A2000 or later.
 

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

Back
Top