Prevent changes of one field on a form

  • Thread starter Thread starter Alain
  • Start date Start date
A

Alain

I am a new Access user and love this program so far.
I have made a database for an apartment building where the information of
the tenants for each unit is kept. This information is updated using a form.
However, one of the field "Unit Number" will never change and I do not want
anyone to have the ability to change that field on the form.
I want to see the unit number (bounded to the field "UnitNumber" in my
database, but I want it to be "read only".
Could anyone give me a solution to my problem.
Thank you for your help,
Alain
 
I am a new Access user and love this program so far.
I have made a database for an apartment building where the information of
the tenants for each unit is kept. This information is updated using a form.
However, one of the field "Unit Number" will never change and I do not want
anyone to have the ability to change that field on the form.
I want to see the unit number (bounded to the field "UnitNumber" in my
database, but I want it to be "read only".
Could anyone give me a solution to my problem.
Thank you for your help,
Alain

I would assume you would want to be able to enter the UnitNumber value
when a new record is being entered.

Code the Form's Current event:

If Me.NewRecord Then
Me![UnitNumber].Locked = False
Else
Me![UnitNumber].Locked = True
End If
 
This works perfectly.
It is so simple once you know what to do....
Thanks a million for the quick answer.
Alain
 
Thank you for the quick response.
This is something I will probably try in the future. For the time being,
locking the fields works for me.
Alain

fredg said:
I am a new Access user and love this program so far.
I have made a database for an apartment building where the information of
the tenants for each unit is kept. This information is updated using a
form.
However, one of the field "Unit Number" will never change and I do not
want
anyone to have the ability to change that field on the form.
I want to see the unit number (bounded to the field "UnitNumber" in my
database, but I want it to be "read only".
Could anyone give me a solution to my problem.
Thank you for your help,
Alain

I would assume you would want to be able to enter the UnitNumber value
when a new record is being entered.

Code the Form's Current event:

If Me.NewRecord Then
Me![UnitNumber].Locked = False
Else
Me![UnitNumber].Locked = True
End If
 

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