General high level question. (Must have arisen before).
I have simple table for "Supplier Details".
The data is UniqueSupplierCode, Name, Address, Email etc.
I want a SINGLE form which will allow me to Add new suppliers and modify existing ones. How can I prevent the user from amending the UniqueSupplierCode once it has been set up.
They can obviously amend the name and address details etc.
I do not want to use autonumbering.
Microsoft Access
Last Comment
Patrick O'Dea
8/22/2022 - Mon
Rey Obrero (Capricorn1)
lock the control that display the UniqueSupplierCode
Patrick O'Dea
ASKER
Thanks capricorn1,
But if I lock the control then I will not be able to add NEW suppliers ?? true?
Scott McDaniel (EE MVE )
You can toggle the control to allow edits based on the NewRecord value. You'd do this in the Current event of the form:
Sub Form_Current()
Me.YourControl.Enabled = Me.NewRecord
Me.YourControl.Locked = Not Me.NewRecord
End Sub
This will Enable and Unlock your control when the form is in the "NewRecord" mode only.