G
Guest
I have a field that I want to protect from modification but I still need a
new record to be added. The field is the reference number for the record.
new record to be added. The field is the reference number for the record.
Sprinks said:aMack,
Are you setting this field programmatically or is the user able to enter the
value for a new record? If it's the former, simply set the control's Enabled
property to False in form design view. If the latter, use the OnCurrent
event and the NewRecord property of the Form object to determine if you're at
a new record, and set the Enabled property accordingly:
' Form's OnCurrent event procedure code
Dim intNewRec as Integer
intNewRec = Me.NewRecord
If intNewRec Then
Me![YourControl].Enabled = True
Else
Me![YourControl].Enabled = False
End If
Hope that helps.
Sprinks
aMack said:I have a field that I want to protect from modification but I still need a
new record to be added. The field is the reference number for the record.
aMack said:I appreciate your assistance in this matter.
The field is added through a macro/query combination.
As I am a new user your instructions are well above me head. Could you be a
little more specific with regards to where I would "Set the control's enabled
property to False."
If this means setting the fields' text box "Enabled" to "NO" - this will
protect it but then not allow a new record.
Thanks again for your help.
--
A MACKENZIE, CMA, MBA
Sprinks said:aMack,
Are you setting this field programmatically or is the user able to enter the
value for a new record? If it's the former, simply set the control's Enabled
property to False in form design view. If the latter, use the OnCurrent
event and the NewRecord property of the Form object to determine if you're at
a new record, and set the Enabled property accordingly:
' Form's OnCurrent event procedure code
Dim intNewRec as Integer
intNewRec = Me.NewRecord
If intNewRec Then
Me![YourControl].Enabled = True
Else
Me![YourControl].Enabled = False
End If
Hope that helps.
Sprinks
aMack said:I have a field that I want to protect from modification but I still need a
new record to be added. The field is the reference number for the record.