Individual record locking

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
 
G

Guest

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
 
G

Guest

Steve,

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

Sprinks
 
G

Guest

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
 

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

Similar Threads


Top