Continuous forms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello. I have a form set to continuous bound to a table.
For each record of the table i have a Yes/No field.
I want to know if its possible to lock all the controls of the continuous
form for the records that has that field value TRUE.

Thanks
 
The user can only change one record (the current one), so it is really just
the current record you need to lock.

To do that, use the Current event of the form.

This example prevents the edit or deletion of a record where MyYesNo is
true:

Private Sub Form_Current()
Dim bAllow As Boolean
bAllow = Not Nz(Me.[MyYesNo], False)
Me.AllowEdits = bAllow
Me.AllowDeletions = bAllow
End Sub
 

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