Individual record locking

  • Thread starter Thread starter Steve T
  • Start date Start date
S

Steve T

We currently have an access database for our order entry. What I am needing
is a way to lock a specific record on a form when a certain field equals a
value.

I have a form called frmInvoice with a subform called frmInvoiceDetails. A
combo box on frmInvoice has 5 values in it (Backlog, Current, 30-60,
60-plus, Paid). The default value is Backlog and all others are selected
when the order changes status.

What I want to do is have all records with "Backlog" in the combo box be
editable and the others not be able to be changed, edited, etc.

I basically don't want users to be able to change any records except if they
are in the Backlog.

Thanks in advance for any help.

Steve T
 
Hi Steve,
Not an expert myself but perhaps it's possible to put something like this on
Form BeforeUpdate and Form Afterupdate.

Private Sub Form_BeforeUpdate(Cancel As Integer)
IF ([ComboBoxFieldname] = "Backlog") Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
End Sub

This can help... I think
 
Steve,

Set the AllowEdits property in both the AfterUpdate event for the combo box,
and in the main form's OnCurrent event.

Sprinks
 
Hmmm... this might not work...
maybe like this... if you lock all fields but the combobox...
Private Sub Form_BeforeUpdate(Cancel As Integer)
IF ([ComboBoxFieldname] = "Backlog") Then
Me.Fieldname1.locked = False
Else
Me.Fieldname1.locked = True
End If
End Sub

Hope I am helping and not confusing you hehehe...

--
Novice


Ben said:
Hi Steve,
Not an expert myself but perhaps it's possible to put something like this on
Form BeforeUpdate and Form Afterupdate.

Private Sub Form_BeforeUpdate(Cancel As Integer)
IF ([ComboBoxFieldname] = "Backlog") Then
Me.AllowEdits = True
Else
Me.AllowEdits = False
End If
End Sub

This can help... I think

--
Novice


Steve T said:
We currently have an access database for our order entry. What I am needing
is a way to lock a specific record on a form when a certain field equals a
value.

I have a form called frmInvoice with a subform called frmInvoiceDetails. A
combo box on frmInvoice has 5 values in it (Backlog, Current, 30-60,
60-plus, Paid). The default value is Backlog and all others are selected
when the order changes status.

What I want to do is have all records with "Backlog" in the combo box be
editable and the others not be able to be changed, edited, etc.

I basically don't want users to be able to change any records except if they
are in the Backlog.

Thanks in advance for any help.

Steve T
 
Back
Top